Aliquot sequence classifications: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Now uses Wren-seq module.)
m (→‎{{header|REXX}}: changed title for 1st section, increased title width.)
Line 2,937: Line 2,937:
numeric digits 100 /*be able to compute the number: BIG */
numeric digits 100 /*be able to compute the number: BIG */
big= 2**47; NTlimit= 16 + 1 /*limits for a non─terminating sequence*/
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, length(big) ) /*be able to handle big numbers for // */
digs= digits() /*used for align numbers for the output*/
digs= digits() /*used for align numbers for the output*/
#.= .; #.0= 0; #.1= 0 /*#. are the proper divisor sums. */
#.= .; #.0= 0; #.1= 0 /*#. are the proper divisor sums. */
say center('numbers from ' low " to " high, 79, "═")
say center('numbers from ' low " ───► " high ' (inclusive)', 133, "═")
do n=low to high; call classify n /*call a subroutine to classify number.*/
do n=low to high; call classify n /*call a subroutine to classify number.*/
end /*n*/ /* [↑] process a range of integers. */
end /*n*/ /* [↑] process a range of integers. */
say
say
say center('first numbers for each classification', 79, "═")
say center('first numbers for each classification', 133, "═")
class.= 0 /* [↓] ensure one number of each class*/
class.= 0 /* [↓] ensure one number of each class*/
do q=1 until class.sociable\==0 /*the only one that has to be counted. */
do q=1 until class.sociable\==0 /*the only one that has to be counted. */
Line 2,953: Line 2,953:
end /*q*/ /* [↑] only display the 1st occurrence*/
end /*q*/ /* [↑] only display the 1st occurrence*/
say /* [↑] process until all classes found*/
say /* [↑] process until all classes found*/
say center('classifications for specific numbers', 79, "═")
say center('classifications for specific numbers', 133, "═")
do i=1 for words($L) /*$L: is a list of "special 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.*/
call classify word($L, i) /*call a subroutine to classify number.*/
Line 2,998: Line 2,998:


<pre style="font-size:75%">
<pre style="font-size:75%">
═══════════════════════════════════════════════numbers from 1 ───► 10 (inclusive)════════════════════════════════════════════════
════════════════════════════numbers from 1 to 10════════════════════════════
1 is terminating 0
1 is terminating 0
2 is terminating 1 0
2 is terminating 1 0
3 is terminating 1 0
3 is terminating 1 0
Line 3,010: Line 3,010:
10 is terminating 8 7 1 0
10 is terminating 8 7 1 0


════════════════════════════════════════════════first numbers for each classification════════════════════════════════════════════════
═════════════════════first numbers for each classification═════════════════════
1 is terminating 0
1 is terminating 0
6 is perfect 6
6 is perfect 6
25 is aspiring 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
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
220 is amicable 284 220
562 is cyclic 284 220 284
562 is cyclic 284 220 284
12496 is sociable 14288 15472 14536 14264 12496
12496 is sociable 14288 15472 14536 14264 12496


════════════════════════════════════════════════classifications for specific numbers═════════════════════════════════════════════════
═════════════════════classifications for specific numbers══════════════════════
11 is terminating 1 0
11 is terminating 1 0
12 is terminating 16 15 9 4 3 1 0
12 is terminating 16 15 9 4 3 1 0
Line 3,032: Line 3,032:
562 is cyclic 284 220 284
562 is cyclic 284 220 284
1064 is cyclic 1336 1184 1210 1184
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
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
15355717786080 is NON─TERMINATING 44534663601120 144940087464480
</pre>
</pre>