Numbers which are the cube roots of the product of their proper divisors: Difference between revisions
Content added Content deleted
m (→{{header|ALGOL 68}}: typo, typo...) |
(→{{header|ALGOL 68}}: Revised the blurb following Rdm's comments on the discussion page) |
||
Line 22: | Line 22: | ||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32 and 3.0.3}} |
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32 and 3.0.3}} |
||
Attempting the task by computing divisor products (as this sample does) requires large integers as some of the products needed are quite big. This ignores numbers where the divisor product is going to be larger than the cube of the maximum number it considers. |
|||
<br> |
<br> |
||
It constructs a table of proper divisor products to avoid factorising each number. As the J sample suggests, alternative approaches could avoid the need for large integers. |
|||
<br> |
|||
Requires an implementation of Algol 68 where LONG INT is more than 64 bits, in ALGOL 68G, LONG INT is 128 bit in version 3 and allows up to 35 digits in version 2. In order to run this under Windows (and probably other operating systems) with Algol 68G, a large heap size must be specified, e.g. with <code>-heap 256M</code> on the command line. |
|||
<syntaxhighlight lang="algol68"> |
<syntaxhighlight lang="algol68"> |
||
BEGIN # find some numbers which are the cube roots of the product of their # |
BEGIN # find some numbers which are the cube roots of the product of their # |