|
|
last edited 7 years ago by KSmarts |
1 2 3 4 5 6 7 8 9 | ||
Editor: KSmarts
Time: 2017/10/28 16:55:28 GMT+0 |
||
Note: |
changed: - if j-i =2*n then if j-i=2*n or i=2 then changed: -for n in 1..30 repeat for n in 0..30 repeat
a : (Integer) -> Integer
a(n) == i:=2 repeat j:=nextPrime(i) if j-i=2*n or i=2 then return i i:=j
for n in 0..30 repeat output(a(n))
Compiling function a with type Integer -> Integer 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2