SGARDERN prime calculation modified