Untouchable numbers: Difference between revisions

Content added Content deleted
(Added Algol 68)
m (→‎{{header|ALGOL 68}}: Notes on how to run with Algol 68G)
Line 69: Line 69:
<br>
<br>
Possibly, this works because the prime + 1 value eliminates the need to calculate the proper divisor sum of p^2 which appears to help a lot when p is close to the upper limit. Why the 64 * limit (or 63 * limit) is valid is unclear (to me, anyway).
Possibly, this works because the prime + 1 value eliminates the need to calculate the proper divisor sum of p^2 which appears to help a lot when p is close to the upper limit. Why the 64 * limit (or 63 * limit) is valid is unclear (to me, anyway).
<br>
<br><br>
Note that under Windows (and possibly under Linux), Algol 68G requires that the heap size be increased in order to allow arrays big enough to handle 100 000 and 1 000 000 untouchable numbers. See [[ALGOL_68_Genie#Using_a_Large_Heap]].
Note that under Windows, Algol 68G does not allow the declaration of an array large enough for untouchables up to 100 000 (or 1 000 000), so the limit on the third line would need to be reduced to 10 000 or another compiler used. Possibly the Linux version of Algol 68G would have larger limits.
<lang algol68>BEGIN # find some untouchable numbers - numbers not equal to the sum of the #
<lang algol68>BEGIN # find some untouchable numbers - numbers not equal to the sum of the #
# proper divisors of any +ve integer #
# proper divisors of any +ve integer #