Wolstenholme numbers: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) (added Arturo) |
m (→{{header|ALGOL 68}}: Change comments and name to better describe the second order harmonic numerator procedure) |
||
Line 43: | Line 43: | ||
a |
a |
||
END # gcd # ; |
END # gcd # ; |
||
# returns the nth second order harmonic number |
# returns the numerator of the nth second order harmonic number # |
||
PROC |
PROC harmonic2numerator = ( INT n )LONG LONG INT: |
||
BEGIN |
BEGIN |
||
LONG LONG INT v := 0, f := 1; |
LONG LONG INT v := 0, f := 1; |
||
Line 59: | Line 59: | ||
print( ( "First ", whole( UPB wols, 0 ), " Wolstenholme numbers:", newline ) ); |
print( ( "First ", whole( UPB wols, 0 ), " Wolstenholme numbers:", newline ) ); |
||
FOR i TO UPB wols DO |
FOR i TO UPB wols DO |
||
wols[ i ] := |
wols[ i ] := harmonic2numerator( i ); |
||
print( ( whole( wols[ i ], -18 ) ) ); |
print( ( whole( wols[ i ], -18 ) ) ); |
||
IF i MOD 4 = 0 THEN print( ( newline ) ) FI |
IF i MOD 4 = 0 THEN print( ( newline ) ) FI |