Anonymous user
Aliquot sequence classifications: Difference between revisions
m
→{{header|REXX}}: adjusted output width to fit Rosetta Code's window width, added whitespace to the REXX section header.
m (→{{header|REXX}}: changed title for 1st section, increased title width.) |
m (→{{header|REXX}}: adjusted output width to fit Rosetta Code's window width, added whitespace to the REXX section header.) |
||
Line 2,928:
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, ···''.
Line 2,940:
digs= digits() /*used for align numbers for the output*/
#.= .; #.0= 0; #.1= 0 /*#. are the proper divisor sums. */
say center('numbers from ' low " ───► " high ' (inclusive)',
do n=low to high; call classify n /*call a subroutine to classify number.*/
end /*n*/ /* [↑] process a range of integers. */
say
say center('first numbers for each classification',
class.= 0 /* [↓] ensure one number of each class*/
do q=1 until class.sociable\==0 /*the only one that has to be counted. */
Line 2,950:
_= what; upper _ /*obtain the class and uppercase it. */
class._= class._ + 1 /*bump counter for this class sequence.*/
if class._==1 then say right(q, digs)
end /*q*/ /* [↑] only display the 1st occurrence*/
say /* [↑] process until all classes found*/
say center('classifications for specific numbers',
do i=1 for words($L) /*$L: is a list of "special numbers".*/
call classify word($L, i) /*call a subroutine to classify number.*/
Line 2,983:
if s>big then do; what= 'NON─TERMINATING'; leave; end
end /*t*/ /* [↑] only permit within reason. */
if aa>0 then say right(a, digs
return /* [↑] only display if AA is positive*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
Line 2,998:
<pre style="font-size:75%">
═════════════════════════════════════════════════════════numbers from 1 ───► 10 (inclusive)══════════════════════════════════════════════════════════
1
2
3
4
5
6
7
8
9
10
══════════════════════════════════════════════════════════first numbers for each classification══════════════════════════════════════════════════════════
1
6
25
138
220
562
12496
══════════════════════════════════════════════════════════classifications for specific numbers═══════════════════════════════════════════════════════════
11
12
28
496
220
1184
12496
1264460
790
909
562
1064
1488
15355717786080
</pre>
|