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
::* &nbsp; (uppercase) &nbsp; '''NON-TERMINATING''' &nbsp; &nbsp; ─── &nbsp; due to a cyclic number that is larger than &nbsp; <big>2<sup>47</sup></big>
 
Both of the above limitations are imposed by this Rosetta Code task's restriction requirements: &nbsp; ''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)', 133153, "═")
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', 133153, "═")
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) 'is:' center(what, digs) $
end /*q*/ /* [↑] only display the 1st occurrence*/
say /* [↑] process until all classes found*/
say center('classifications for specific numbers', 133153, "═")
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 ) 'is:' center(what, digs) $
return /* [↑] only display if AA is positive*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
Line 2,998:
 
<pre style="font-size:75%">
═════════════════════════════════════════════════════════numbers from 1 ───► 10 (inclusive)══════════════════════════════════════════════════════════
═══════════════════════════════════════════════numbers from 1 ───► 10 (inclusive)════════════════════════════════════════════════
1 is: terminating 0
2 is: terminating 1 0
3 is: terminating 1 0
4 is: terminating 3 1 0
5 is: terminating 1 0
6 is: perfect 6
7 is: terminating 1 0
8 is: terminating 7 1 0
9 is: terminating 4 3 1 0
10 is: terminating 8 7 1 0
 
══════════════════════════════════════════════════════════first numbers for each classification══════════════════════════════════════════════════════════
════════════════════════════════════════════════first numbers for each classification════════════════════════════════════════════════
1 is: terminating 0
6 is: perfect 6
25 is: aspiring 6
138 is: non─terminating 150 222 234 312 528 960 2088 3762 5598 6570 10746 13254 13830 19434 20886 21606 25098 26742 26754
220 is: amicable 284 220
562 is: cyclic 284 220 284
12496 is: sociable 14288 15472 14536 14264 12496
 
══════════════════════════════════════════════════════════classifications for specific numbers═══════════════════════════════════════════════════════════
════════════════════════════════════════════════classifications for specific numbers═════════════════════════════════════════════════
11 is: terminating 1 0
12 is: terminating 16 15 9 4 3 1 0
28 is: perfect 28
496 is: perfect 496
220 is: amicable 284 220
1184 is: amicable 1210 1184
12496 is: sociable 14288 15472 14536 14264 12496
1264460 is: cyclic 1547860 1727636 1305184 1264460 1547860
790 is: aspiring 650 652 496
909 is: aspiring 417 143 25 6
562 is: cyclic 284 220 284
1064 is: cyclic 1336 1184 1210 1184
1488 is: non─terminating 2480 3472 4464 8432 9424 10416 21328 22320 55056 95728 96720 236592 459792 881392 882384 1474608 2461648 3172912 3173904
15355717786080 is: NON─TERMINATING 44534663601120 144940087464480
</pre>