Nice primes: Difference between revisions
→{{header|ALGOL W}}: Faster digital root algorithm
(Added Forth solution) |
(→{{header|ALGOL W}}: Faster digital root algorithm) |
||
Line 27:
% returns the digital root of n in base 10 %
integer procedure digitalRoot( integer value n ) ;
end digitalRoot
▲ sum > 9
% sets p( 1 :: n ) to a sieve of primes up to n %
procedure Eratosthenes ( logical array p( * ) ; integer value n ) ;
|