Double Twin Primes: Difference between revisions
Content deleted Content added
→{{header|ALGOL 68}}: Tweak |
|||
Line 27:
[]BOOL prime = PRIMESIEVE 1 000;
INT count := 0;
WHILE p <= UPB prime - 8 DO
BOOL is double twin := FALSE;
IF prime[ p ] THEN
IF prime[ p + 2 ] THEN
IF prime[ p + 6 ] THEN
IF prime[ p + 8 ] THEN
count +:= 1;
is double twin := TRUE;
print( ( "["
, whole( p, -4 ), whole( p + 2, -4 )
Line 43 ⟶ 46:
FI
FI
FI;
p +:= IF is double twin THEN 6 ELSE 2 FI
OD;
print( ( "Found ", whole( count, 0 ), " double twin primes below ", whole( UPB prime, 0 ), newline ) )
|