Wilson primes of order n: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added wording to the REXX section header.)
Line 138: Line 138:
sgn = -sgn
sgn = -sgn
for p in primes(limit)
for p in primes(limit)
if p > n
if p > n && (facts[n < 2 ? 1 : n - 1] * facts[p - n] - sgn) % p^2 == 0
if (facts[n < 2 ? 1 : n - 1] * facts[p - n] - sgn) % p^2 == 0
print("$p ")
print("$p ")
end
end
end
end
end
Line 151: Line 149:
</lang>
</lang>
Output: Same as Wren example.
Output: Same as Wren example.



=={{header|Nim}}==
=={{header|Nim}}==