Jump to content

Cousin primes: Difference between revisions

Change syntax for "collect" to work with Nim 1.4.8. Previous syntax worked only in development version.
m (Added a general comment.)
(Change syntax for "collect" to work with Nim 1.4.8. Previous syntax worked only in development version.)
Line 975:
 
const
PrimeList = collect(newSeq):
for n in 2..N:
if n.isPrime: n
PrimeSet = PrimeList.toHashSet
 
let cousinList = collect(newSeq):
for n in PrimeList:
if (n + 4) in PrimeSet: (n, n + 4)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.