prime calculation utils