-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprog.sf
90 lines (84 loc) · 3.34 KB
/
prog.sf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/ruby
# Numbers m such that sigma(m) is a perfect number.
# https://oeis.org/A146542
# List of perfect numbers:
# https://oeis.org/A000396
# It took ~8 minutes to compute the first 58 terms.
var count = 0
Hash(
1 6
2 28
3 496
4 8128
5 33550336
6 8589869056
7 137438691328
8 2305843008139952128
9 2658455991569831744654692615953842176
10 191561942608236107294793378084303638130997321548169216
11 13164036458569648337239753460458722910223472318386943117783728128
12 14474011154664524427946373126085988481573677491474835889066354349131199152128
).values.sort.each {|n|
n.inverse_sigma.each {|k|
say "#{++count} #{k}"
}
}
__END__
1 5
2 12
3 427
4 10924032
5 16125952
6 22017387
7 24376323
8 32501857
9 33288097
10 3757637632
11 6241076643
12 8522760577
13 45091651584
14 66563866624
15 86692869921
16 137421905953
17 137437511683
18 727145809044307968
19 1152771972099211264
20 845044701535107443245558061611352064
21 865484379031831961839916580291477504
22 1153985775214609089163288965856362496
23 1277619797618418610335114951858847744
24 60891539648630763367689544568995078723938299544600576
25 69038754742811902391596509377915255971548554021830656
26 81178653925051265629821733062034657840116860251537408
27 81189184100631660280193809089335100413611552144359424
28 83152962745979644598887872690993279547743699378110464
29 121784008378799380226500728976877595835078592616727179
30 125711325950422430410475030587190963742276425815818219
31 139181458393414286282809421415274972184429393487593379
32 142531350837341796421688053359890561352951832964996739
33 142547936069586049644350323307828213435213354228121219
34 142549023698706947029914603613515011968574178730180227
35 143670086733581180044844015202254360496433290628694019
36 162357307925706044272146760262706078493186639572689113
37 162357617522682339842597572378742562948222292451844313
38 162378677914012637753681673247893905679600342620700889
39 166307194237715282674898844946918867430698723250799481
40 185573862117290254415463140390615232190979485728112609
41 190065002322189401698030070104730338359382074977681281
42 4151775521412516844093212490432766775068318906092876273085841408
43 4744886307976223666718804471874873128046666253972282873361727488
44 4897900448508591277284725445797136888636326459007835552106938368
45 5534982721613829855299294336534368625896358645540896670834753536
46 6581968012470941075173766033280273521958702267142003047880720384
47 9872933182947434132059085755390702261716462371421577071114190851
48 11157130520262355005131429794916357874587227283718121245501481177
49 11158577779334428468524123061135819120155863841850084630267429081
50 4564890631965781561750064145662508238491806228043066370383691000114090868736
51 4748696105994865570466638607043671420877556093904982803073020948857044860928
52 5257454890866601084843556638356596063110773515354000502568005090019368763392
53 5427081261466950430464459691046750866779305330148985592865943132819798622208
54 5427712772521115917097165313747038567606729803804059961050365258257152344064
55 6086555670238378989670371734243169622657830773351885970528324860512791691264
56 7009979965992420604022180800873991145104963757669260328345888067360399556608
57 7179535173549014384678835409368684946398583187633957675549856413252256268288
58 7236991773839568632845611693531225085373142669868542456122287030581053095936