Anonymous user
Aliquot sequence classifications: Difference between revisions
m
→{{header|J}}
(J solution) |
m (→{{header|J}}) |
||
Line 114:
aliquot =: [: +/ proper_divisors ::0:
rc_aliquot_sequence =: aliquot^:(i.16)&>
rc_classify =: [: {. ([;.1' terminate non-terminating perfect amicable sociable aspiring cyclic') #~ (6 > {:) , (([: +./ (2^47x)&<) +. (16 = #@:~.)) , (1 = #@:~.) , ((8&= , 1&<)@:{.@:(#/.~)) , ([: =/ _2&{.) , 1:
▲rc_display_aliquot_sequence =: (":,~' ',~_15{.rc_classify)@:rc_aliquot_sequence
</lang>
<lang J>
rc_display_aliquot_sequence&> >: i.10
terminate
terminate
terminate
terminate
terminate
perfect
terminate
terminate
terminate
terminate
rc_display_aliquot_sequence&>11, 12, 28, 496, 220, 1184, 12496, 1264460, 790, 909, 562, 1064, 1488, 15355717786080x
terminate
terminate
perfect
perfect
amicable
amicable
sociable
sociable
aspiring
aspiring
cyclic
cyclic
non-terminating 1488 2480 3472 4464 8432 9424 10416 21328 22320 55056 95728 96720 236592 459792 881392 882384
non-terminating 15355717786080 44534663601120 144940087464480 471714103310688 1130798979186912 2688948041357088 6050151708497568 13613157922639968 35513546724070632 74727605255142168 162658586225561832 353930992506879768 642678347124409032
</lang>
|