Untouchable numbers: Difference between revisions

m
→‎{{header|REXX}}: elided the incorrect number of untouchable numbers for one million.
m (→‎{{header|Phix}}: to 1 million)
m (→‎{{header|REXX}}: elided the incorrect number of untouchable numbers for one million.)
Line 371:
 
=={{header|REXX}}==
{{incorrect|REXX|sorry, 150,232 not that +20}}
Some optimization was done to the code to produce prime numbers,   since a simple test could be made to exclude
<br>the calculation of touchability for primes as the aliquot sum of a prime is unity.
Line 378 ⟶ 377:
A fair amount of code was put into the generation of primes, &nbsp; but the computation of the aliquot sum was the area
<br>that consumed the most CPU time.
 
This version doesn't appear to calculate the correct number of untouchable numbers for one million.
<lang rexx>/*REXX pgm finds N untouchable numbers (numbers that can't be equal to any aliquot sum).*/
parse arg n cols tens over . /*obtain optional arguments from the CL*/
Line 472 ⟶ 473:
1,212 untouchable numbers were found ≤ 10,000
13,863 untouchable numbers were found ≤ 100,000
150,252 untouchable numbers were found ≤ 1,000,000
</pre>