Gaussian primes: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
Alextretyak (talk | contribs) m (→{{header|11l}}) |
||
Line 58: | Line 58: | ||
V lim = Int(sqrt(limitsquared)) |
V lim = Int(sqrt(limitsquared)) |
||
V testvals = multiloop((-lim .< lim), (-lim .< lim), (r, c) -> Complex(r, c)) |
V testvals = multiloop((-lim .< lim), (-lim .< lim), (r, c) -> Complex(r, c)) |
||
testvals = |
testvals .= filter(c -> is_gaussian_prime(c) & norm(c) < :limitsquared) |
||
V gprimes = sorted(enumerate(testvals).map((i, c) -> (c, i)), key' c -> (norm(c[0]), c[1])) |
V gprimes = sorted(enumerate(testvals).map((i, c) -> (c, i)), key' c -> (norm(c[0]), c[1])) |
||
print(‘Gaussian primes within ’lim‘ of the origin on the complex plane:’) |
print(‘Gaussian primes within ’lim‘ of the origin on the complex plane:’) |