Sum of primes in odd positions is prime: Difference between revisions

m
Line 811:
end sub
 
print "pi\tp(n)\tsum\n----\t-----\t------"
for n = 2 to 999
if isPrime(n) then
Line 817:
if mod(i, 2) then
sum = sum + n
if isPrime(sum) print i, "\t", n, "\t", sum
end if
end if
next</lang>
{{out}}
<pre>i p(n) sum
---- ----- ------
1 2 2
3 5 7
11 31 89
27 103 659
35 149 1181
67 331 5021
91 467 9923
95 499 10909
99 523 11941
119 653 17959
143 823 26879
---Program done, press RETURN---</pre>
</pre>
672

edits