Prime numbers p for which the sum of primes less than or equal to p is prime: Difference between revisions
Content added Content deleted
(Realize in F#) |
(→{{header|XPL0}}: Made it less stupid.) |
||
Line 409: | Line 409: | ||
]; |
]; |
||
int Count, N |
int Count, N, Sum; |
||
[Count:= 0; |
[Count:= 0; |
||
Sum:= 0; |
|||
for N:= 2 to 1000-1 do |
for N:= 2 to 1000-1 do |
||
if IsPrime(N) then |
if IsPrime(N) then |
||
[Sum:= |
[Sum:= Sum + N; |
||
for M:= 2 to N do |
|||
if IsPrime(M) then |
|||
Sum:= Sum + M; |
|||
if IsPrime(Sum) then |
if IsPrime(Sum) then |
||
[IntOut(0, N); |
[IntOut(0, N); |