-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodd_abundant_cyclic_numbers.sf
96 lines (80 loc) · 5.73 KB
/
odd_abundant_cyclic_numbers.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
91
92
93
94
95
96
#!/usr/bin/ruby
# Generate odd abundant cyclic numbers.
# If all odd cyclic numbers have Carmichael multiples, then abundant Carmichael numbers do exist.
# See also:
# http://www.numericana.com/data/crump.htm
var min = Inf
func lambda_primes(L,n) {
L.divisors.map { .inc }.count { .is_odd && !.divides(L) && .is_prime && is_coprime(_,n) }
}
func f(n, p) {
n.is_cyclic || return nil
if (n.is_abundant) {
if (n.is_pseudoprime) {
die "Found: #{n}"
}
var c = lambda_primes(n.lambda, n)
if (c < min) {
min = c
say [min, n]
}
}
var q = p.next_prime
if (q.dec.is_smooth(29)) {
f(n*q, q)
}
f(n, q)
}
say f(5, 5)
__END__
[72, 19443264100119335640177836911507709776732274285097098581067687255943662787603256966400110255773609005]
[73, 7498366409610233567365151142116355486591698528768645808356223392188068950097669481835754051590285]
[74, 3154550445776286734272255423692198353635548392414238876043846610091741249515216441664179239205]
[75, 1447705574013899373231874907614593094830449009827553408005436718720395249892251694201091895]
[76, 685142249888262836361512024427161900061736398403953340277064230345667415945220868055415]
[77, 327976184723917106922696038500316850197097366397296955613721508063986316871814680735]
[121, 22895460689396227049643049082435390996704193751949787854065208499027840629999779295]
[122, 15757371431105455643250549953499924980525942017859454820416523399193283296627515]
[123, 11183372200926512166962774984740897786036864455542551327478015187504104539835]
[124, 8622492059311111925183326896484886496558877760634195318024684030458060555]
[125, 6752147266492648336087178462400067734188627847011899231029509812418215]
[142, 13279749380381506242241462610559765777508143336721318330869230395809521683933024508051275304693374950415]
[143, 5121384257763789526510398230065470797342130095148985087107300576864451092916708256093820017236164655]
[144, 2154557954465203839507950454381771475533079552018925152337947234692659273418892829656634420377015]
[145, 988782907051493271917370561900767083769196673712218977667713278886029955676407907139345764285]
[146, 467952156673683517234912712683751577742165960109900131409234869326090845090585852881848445]
[147, 224007734166435384028201394295716408684617501249353820684171790007702654423449426942005]
[148, 125635296784315975338307007456935731174771453308667313900264604603310518465198781235]
[149, 80175683972122511383731338517508443634187270777707283918484112701538301509380205]
[157, 837839927864197275073880887372657965425945172005845792735]
[158, 1226705604486379612114027653547083404723199373361414045]
[159, 2126006246943465532260013264379693942327901860245085]
[160, 4065021504672018226118572207226948264489296099895]
[256, 19560340012826425693128516437578862635]
[267, 1444042546834207706608856246099100718186135986205]
[268, 3334971239801865373230614887064897732531491885]
[269, 8400431334513514794031775534168508142396705]
[354, 17277031840122951876810012573270045985]
[365, 108721665604982208684996146186916657275804701816694818104210326200738548065]
[366, 45739026337813297721916763225459258424823181243876658857471740092864345]
[367, 21895177758646863437968771290310798671528569288595815633064499805105]
[368, 13972672468823780113572923605814166350688302034840979982810784815]
[369, 9020447042494370634972836414340972466551518421459638465339435]
[370, 8075601649502569950736648535667835690735468595756166934055]
[371, 8692789719593724381847845571224796222535488262385540295]
[371, 749441775250366193404374040053950505478960388208146289040143826523399286243548010295583368548324203163393334588181811828579997802655306390667158077217127007993882900114843784382680047251925321617489628460427595587464028068075748724323228097728128487006672847932676853329367534532200471253]
[372, 11304017840824088923079122979486080913570205802842055]
[372, 78058720471863992647054894287464900060302092303733599525064454382189280933605667148795268050028559854535291593394626791852931757385200124014910746507356213727099562557529818183801692245799950173678744762048494488851580884082465235321656920917417819706975611700101744956709460944922453]
[373, 8306770296037457980957209139881334474864541056053378687353884684706744805108616276343010327767219309836681025156393188448752980460274568906556427211594787030658674317072450588890251382973284045299430111955783174295155994900762502428610931245867598138445845663520458120326642646049]
[374, 895029662324906581290508473212082154386870063145499265957750747193917121550330382107855869816530471914306758448054432544850014056704511249494281565735889131630069423238061694740895526664506415827974368274516019210769959584178698677794519043838767173628471680155205055524904929]
[375, 99436691737018840272248469415851811397274754265692619259832323874449185818279122553922438597548102645740113148322901071530942568237363765081022282605920356808140142566166169841228255378791958207751846269805134897319182266879091065192147432933981465795852869698389629543929]
[634, 207093460403925930428246384004848306979999376211770028014102314959732822821308183615]
[1872, 8177568910636879136524885826320973235]
[2042, 6338463309645650568607942657649881960845]
[2043, 14116844787629511288659115050445171405]
[2501, 12323002272052203897344375826801547162455]
[13007, 32191855367935690463909332010015911340215752429045385557144051868841972875910238723935258762195149]
[13008, 50221303226108721472557460234034183058058896145156607733454059077756587949937969928136129114189]
[13009, 83562900542610185478464992069940404422726948660826302385114906951342076455803610529344640789]
[19395, 73447150516193077029324563940188527242280274750433560293457441337357999076671648487217809]
[67203, 40542717851817232210736438956403988625170178569305257750601545346180181401242017175219]