Jump to content

Odd squarefree semiprimes: Difference between revisions

→‎{{header|ALGOL 68}}: Calculate a more sensible number of primes
(→‎{{header|ALGOL 68}}: Calculate a more sensible number of primes)
Line 28:
# show odd square free semi-primes up to 1000 #
INT max number = 1000;
[]INT max prime = 1 =+ prime list( 100 * max number OVER 3 ); # (very)the roughsmallest approximationodd ofprime whereis the3, lastso primethis undershuld 1001be isenough primes #
[]INT prime = prime list( max prime );
[ 1 : max number ]BOOL numbers; FOR i TO max number DO numbers[ i ] := FALSE OD;
FOR i FROM 2 TO maxUPB numberprime - 1 DO
FOR j FROM i + 1 TO maxUPB numberprime
WHILE INT pq = prime[ i ] * prime[ j ];
pq < max number
3,022

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.