Strange unique prime triplets: Difference between revisions
Content added Content deleted
(Added Algol W) |
m (→{{header|ALGOL W}}: Minor comment and case changes) |
||
Line 209: | Line 209: | ||
% construct a sieve of primes up to MAX_PRIME * 3 % |
% construct a sieve of primes up to MAX_PRIME * 3 % |
||
Eratosthenes( p, MAX_PRIME * 3 ); |
Eratosthenes( p, MAX_PRIME * 3 ); |
||
% count the |
% count the strange prime triplets whose members are < 1000 and % |
||
% |
% whose sum is prime % |
||
sCount := c30 := 0; |
sCount := c30 := 0; |
||
% 2 cannot be one of the primes as the sum would be even otherwise % |
% 2 cannot be one of the primes as the sum would be even otherwise % |
||
Line 217: | Line 217: | ||
for m := n + 2 step 2 until MAX_PRIME - 3 do begin |
for m := n + 2 step 2 until MAX_PRIME - 3 do begin |
||
if p( m ) then begin |
if p( m ) then begin |
||
for l := m + 2 |
for l := m + 2 step 2 until MAX_PRIME do begin |
||
if p( l ) then begin |
if p( l ) then begin |
||
integer s; |
integer s; |