Pell numbers: Difference between revisions
Content added Content deleted
(→{{header|ALGOL 68}}: Typo) |
(→{{header|ALGOL 68}}: Simplify a bit) |
||
Line 127: | Line 127: | ||
print( ( newline, "First 10 Pell primes:", newline, "index Pell prime", newline ) ); |
print( ( newline, "First 10 Pell primes:", newline, "index Pell prime", newline ) ); |
||
INT |
INT c := 0; |
||
FOR pdx FROM 2 WHILE c < 10 DO |
|||
⚫ | |||
IF is probably prime( p[ pdx ] ) THEN |
IF is probably prime( p[ pdx ] ) THEN |
||
print( ( whole( pdx, -5 ), " ", whole( p[ pdx ], 0 ), newline ) ); |
print( ( whole( pdx, -5 ), " ", whole( p[ pdx ], 0 ), newline ) ); |
||
c +:= 1 |
c +:= 1 |
||
FI |
FI |
||
OD; |
|||
c < 10 |
|||
DO SKIP OD; |
|||
[ 0 : 20 ]LONG INT nsw; |
|||
⚫ | |||
print( ( newline, newline, "First 20 Newman-Shank-Williams numbers:", newline ) ); |
print( ( newline, newline, "First 20 Newman-Shank-Williams numbers:", newline ) ); |
||
FOR n FROM 0 TO 19 DO |
FOR n FROM 0 TO 19 DO |
||
⚫ | |||
print( ( " ", whole( nsw, 0 ) ) ); IF n = 13 THEN print( ( newline ) ) FI |
|||
⚫ | |||
print( ( newline, newline, "First 20 near isosceles right triangles:", newline ) ); |
print( ( newline, newline, "First 20 near isosceles right triangles:", newline ) ); |