Aliquot sequence classifications: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: optimized the CLASSIDY subroutine (for speed), used a template for OUTPUT.) |
m (→{{header|REXX}}: added wording to the REXX section header, changed a program comment.) |
||
Line 2,037: | Line 2,037: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
Programming notes: |
|||
This REXX version uses memoization. |
This REXX version uses memoization. |
||
Two versions of ''classifications'' of ''non-terminating'' are used: |
|||
::* (lowercase) '''non-terminating''' ─── due to more than sixteen cyclic numbers |
|||
::* (uppercase) '''NON-terminating''' ─── due to a cyclic number that is larger than <big>2<sup>47</sup></big> |
|||
Both of the above limitations are imposed by this Rosetta Code task's restriction requirements: ''For the purposes of this task, ···''. |
|||
<lang rexx>/*REXX program classifies various positive integers for types of aliquot sequences. */ |
<lang rexx>/*REXX program classifies various positive integers for types of aliquot sequences. */ |
||
parse arg low high L /*obtain optional arguments from the CL*/ |
parse arg low high L /*obtain optional arguments from the CL*/ |
||
Line 2,043: | Line 2,051: | ||
if L='' then L=11 12 28 496 220 1184 12496 1264460 790 909 562 1064 1488 15355717786080 |
if L='' then L=11 12 28 496 220 1184 12496 1264460 790 909 562 1064 1488 15355717786080 |
||
numeric digits 20 /*be able to handle the number: BIG */ |
numeric digits 20 /*be able to handle the number: BIG */ |
||
big=2**47; NTlimit=16+1 /* |
big=2**47; NTlimit=16+1 /*limits for a non─terminating sequence*/ |
||
numeric digits max(9, 1 + length(big) ) /*be able to handle big numbers for // */ |
numeric digits max(9, 1 + length(big) ) /*be able to handle big numbers for // */ |
||
#.=.; #.0=0; #.1=0 /*#. are the proper divisor sums. */ |
#.=.; #.0=0; #.1=0 /*#. are the proper divisor sums. */ |