Skip to content

briandfoy/excellent_numbers

Repository files navigation

Excellent Numbers

A seemingly useless number theory problem wastes so much time, but is too much fun to put that time to good use. I want to compute very large "Excellent Numbers".

A number ab is excellent if - is the number ab, where a and b have an equal number of digits. For instance, 48 is 8² - 4².

The Numbers

I'm currently working on the 32-digit numbers. So far:

[2 digits]
48

[4 digits]
3468

[6 digits]
140400
190476
216513
300625
334668
416768
484848
530901

[8 digits]
16604400
33346668
59809776

[10 digits]
3333466668
4848484848
4989086476

[12 digits]
101420334225
181090462476
238580543600
243970550901
268234583253
274016590848
320166650133
333334666668
346834683468
400084748433
440750796876
502016868353
569466945388

[14 digits]
33333346666668
48484848484848

[16 digits]
1045751633986928
1140820035650625
3333333466666668

[18 digits]
103495840337945601
115220484358463728
134171310390093900
139601140398860400
140400140400140400
146198830409356725
168654484443958128
189525190474810476
190476190476190476
215488216511784513
216513216513216513
225789700526090001
241951680548171776
271851166588008693
299376300623700625
300625300625300625
332001666665001333
333333334666666668
334668334668334668
344329484680361873
415233416766584768
416768416768416768
468197520829099776
483153484846516848
484848484848484848
529100530899470901
530901530901530901
572945416949321793

[20 digits]
21733880705143685100
22847252005297850625
23037747345324014028
23921499005444619376
24981063345587629068
26396551105776186476
31698125906461101900
33333333346666666668
34683468346834683468
35020266906876369525
36160444847016852753
36412684107047802476
46399675808241903600
46401324208242096401
48179452108449381525

[22 digits]
1283162072038050132225
1382185301039663949900
1401308698439970930753
2178784179051512078476
2338121616653710361068
2367149758454106280193
3333333333466666666668
3576505852069682460225
4848484848484848484848

[24 digits]
101510361784334387074113
104809496370340285948725
104867119466340388354988
108155856320346198708225
117348405020362103649776
119955572010366530914476
123633057940372717307025
157290668240426650937601
158614297300428687290001
165956011660439883404400
166044001660440016604400
185772506140469344148976
190380966190476052390476
210517086430504811380725
233207473870536277166901
238089296484542932601328
238470751420543451056401
243821120534550699427413
244080746030551050049100
249488568480558330649600
262468374516575637057648
268116781766583098096748
268391679350583460172501
274134775984591003089153
279933548734598578600053
326675749084658325750768
326741575916658408409233
326853064080658548395776
333200016666666500013333
333333333334666666666668
333466683334666833346668
340007582584674990917568
362683545166703009885493
370100219416712091561408
407651575834757516589333
415080116584766401735233
440965427266797129810828
448806505800806370749376
448943047484806531405073
449373011416807037244993
456713305850815659456876
457449621834816522980908
485018201516848681835153
493193923850858157427500
493339234266858325599253
501781323700868081690001
578571099120955675476225
579021625716956183909488
588395216966966749268588
597902255980977440209776
598097765980977659809776

[26 digits]
17496568697344534078501653
33333333333346666666666668
47509369642848371425904913
48484848484848484848484848
55969768436669343228469068

[28 digits]
1315845549751638587439677073
1972326939807048593562285100
2358780406696653992267107413
2539184952978056426332288401
2660246258358458033932090368
2976742514109062151766778101
3119882136462063978501006225
3333333333333466666666666668
3468346834683468346834683468
3555684841116069426034814400
3831417624521072796934865900
4038515677201675295926614273
4266805990944078021595262976
4690875838726683013899150453
5131073116985088112792772501
5742239882566695076662591093
5824675383423496007081591148

[30 digits]
100219055314266332058600795628
100416430049416332415236523968
100767042979370333048104528725
100840912601660333181335395601
101648857539284334636142367088
102629078238834336395312005068
103401005011880337776217116225
103704531508266338318136320853
103711297991734338330210479148
104965604767266340563331777548
105695042964416341857404588033
106741812902950343708637547500
106748687197050343720772452501
107689478275016345378780480448
108232034753680346332510891776
108781393279084347296393305233
109285518652266348179326266453
109700871462610348905650086476
110068866173216349548310643713
110078307495210349564788381525
110342852117084350026280628208
110882639380740350966663796976
111827315468734352608371927948
112754128115084354214089954193
113417428648350355360298527500
114992199473650358071788072501
115047400926516358166588875153
115321126280716358636429336688
115898438479084359626037045393
116096423959766359965003321173
116557869304834360754218550133
116938353145580361404111185776
117430759369834362244037378133
117697641105340362698739764976
118539839632420364131203294225
118756271238550364498728663125
118759916311450364504916336876
119638209367550365993866763125
120111045622790366793823425900
120952630950516368214842020753
122027335234234370024331333228
122859766258084371421981609968
124546985688130374244488713100
125729304037984376214250038273
126827319166766378037680732748
126918525393516378188891272048
127315704121166378846925072693
127919666803350379846163543125
128320274918584380508039171008
129430802569466382339031781013
131088090243984385061264797953
132487235185716387350103488913
132494982314284387362753311088
133520375168470389034787330901
133930668823416389702569756608
134033794573084389870302358033
134763794243470391056357169100
135378040175766392052616287148
135791514872380392722357886225
135908990210860392912514220400
137365207297400395264983869376
137531444349620395532985393776
137770493634510395918176585525
138272036940834396725589218293
139237829841250398277545312501
139601139601140398860398860400
139820718251530399212414015276
140400140400140400140400140400
141300241198710401579381145900
142221541155716403049014295313
142773439750534403927833713813
143401805984166404927010637333
145202538234220407782191057776
146396643952330409668916703276
146411037656130409691627451276
146459799098216409768558884288
147054531772234410706180970028
147705907782610411731639513525
147978374044084412160130566768
148795722079084413443936934768
149181141356766414048492683253
149231745138150414127829172501
150489001604480416096072089600
151707419223870417998277833100
152490037129016419217423961153
152666345809916419491786514193
153776675191490421217213589900
154156683280120421806787854401
154220892036784421906358778113
155376119400416423695477767168
156362285469180425219296112401
157938021008560427647564577025
157946574091440427660723422976
159506683799284430057049675888
160474008440734431539008463628
161100317092416432496970231808
161733251100916433463834261393
162430910219284434528147320688
163786431355666436591830491468
164339467814590437432198741900
164343842235410437438842258101
164603832403780437833591728401
165065564620266438534155162028
165404240945534439047610024588
165620278901980439374960239600
166226236083960440292400169025
167008022669734441474463933973
167515411417850442240686143125
167701401065630442521367828725
168529894667916443770458756208
168937505316790444384277421525
170584144432970446859144210901
170704026658166447039026680533
172922085191834450360003484908
174013773850070451989565520725
174280139687584452386678381568
175664757775750454447868187500
176867500959484456234165593873
177279087468266456844571295148
177348629425010456947661974476
177393874534984457014727615553
177403014965016457028275584448
177624785259120457356917076225
180772634514600462007986840000
181824276426984463556192845248
182890561720266465123122717653
184124120718216466932342581313
184247680896484467113357561328
185978412186416469644953114368
187700881792300472157286100625
188435311658060473226350003601
189525189525190474810474810476
189730022102166475107886052268
189739524397834475121680747733
190476190476190476190476190476
190485714423810476204285809525
190910541938700476820067700625
191933574840484478301235615728
192007309697250478407897796876
193009310064334479856128267468
193779829126990480968243549900
197599659232660486462007315601
198128902873016487220653325248
199041018299070488526708854901
200909428094284491196525223313
200982729668734491301116723573
200992555831266491315136476428
202402819128090493325166922476
202412685771910493339215077525
203084721655716494295585480688
203900186311040495454813569025
204540163919780496363619311600
206738303802220499478758368401
208334178109720501734300081600
208341028565584501743971313408
211744385176120506537333105600
212049521090240506965995393025
212769043724880507976091654401
212831126434584508063199625793
214373178874766510224498329548
215488215488216511784511784513
215769944635234512178302589173
216513216513216513216513216513
216523480986784513230843583488
217667413435766514826685698773
217883924749466515128459137813
218848250424240516471496926976
220360210650350518573845356876
221617092584834520318391286133
223517301247834522950557132268
225454628173766525627641528428
226228962340834526695837977333
227751253993910528792858962476
227893114819466528988077938988
227973637978130529098873171276
229421055683916531088576863633
229852781241334531681372897068
230092783984090532010782997525
230255091920260532233500707601
230975765422766533221876553653
232198762369080534897212195776
232611835557740535462511852400
233089510636130536115874233100
233614202999466536833120105813
234180293398660537606457564400
235748668119950539746331752501
238923850387484544066592129553
241988363939584548221426270208
242235831841360548556314401025
242290147322166548629804888108
243097286145416549721362761793
243593181625534550391514978188
244322491411234551376433319948
244333519088766551391319880053
246009725680840553651976254400
246344311037530554102725690901
248396906137710556864372281525
250109635971130559164077866901
250362042719734559502631946028
251309202674166560772251473708
252434618781666562279161574668
252585462306870562481002413100
254211087018034564654198409013
255117690032050565864582563125
257623145589950569203681236876
258567823993834570460466289068
259298928536766571432290719628
260599433069310573159225333900
261829004353234574789902376373
263581229258420577110295936401
263596816955166577130920038133
265734622765234579956474661173
267093991210984581750110745153
268633311594550583778354936876
269159921050340584471542635025
269248889557916584588619531793
270342124000660586026439684976
270960071811966586838506173813
272214225954280588485183132225
274394046445980591342658000401
274405873454020591358145999600
277486381751784595386491121088
279293208849266597744013235253
279480027492450597987552763125
280065254901266598750199919948
280599372069416599445893867968
281507290553734600627709308053
283253325860584602897812628033
283404806872166603094595756268
283709511643390603490346766476
285944857135850606390401027500
287860563866410608871306678101
289664241932820611203415392401
293255131964810615835777126101
295739481364790619032569581525
295876774067240619209043457601
296898199585716620521345727088
299363825523700623684636299376
299376299376300623700623700625
299645353064284624045423568913
300625300625300625300625300625
301284650071834626144624220908
302456674500220627643779902225
304864876831916630719803048593
304960884978020630842314960401
305529939042370631568272393100
307992570208484634706226148848
309996495781470637255304550901
311566770601984639250047434753
311855323487920639616343033600
314224352569340642620647284976
314300835777666642717551610508
314379385370490642817068314476
314396747788016642839064469248
316254424953400645190891330625
319035802906770648706132577100
319048777193230648722513422901
323557615034584654405948384833
326954898342234658676251197973
328453833988890660557155022101
331301388033520664124986539776
332725989093216665907330573313
333320000166666666650000133333
333333333333334666666666666668
333346666833334666683333466668
334668334668334668334668334668
335373049753700669214563690001
336171136070584670210540649408
337249596913216671555572928513
343291586780516679073413067248
345751183198380682125401873776
347284978636310684026194690476
347303454100716684049079621488
348024735121510684942297845525
349280139723580686495998334225
351447456175234689175428049548
352007660235516689867417044753
352529639374730690511973837100
353152507104880691280840454401
353464543825984691665907478528
356026188587916694824319917168
357513539107766696655919197653
357619583682350696786445272501
362666289445910702988710397525
363749961260334704318106807733
366108050935560707208000446400
367431742678766708828489979573
367729831144466709193245778613
369614599388520711498103630401
369805471148916711731380255633
370748487868016712883531247873
371137626149750713358790296876
372441372658984714950312068673
373779550299490716582655749900
376013888540800719305451749376
378225805963860721997622060400
380899700394400725247738469376
384688670146460729845218580976
385347011274430730643093700725
389136965143016735230945202753
390079167642484736370100337553
390513088117410736894537982476
390743393375666737172837835468
391859833347484738521470465553
393242112962830740190159601100
395580190871430743010012234901
399605509363240747856986646976
402773564432170751664891183276
403980299704234753113791039148
406184410066984755758020168128
406299450851440755895954886400
409501533849010759732216029900
410723997804550761195244452501
410762282991966761241049944588
415233415233416766584766584768
416768416768416768416768416768
417469236933034769252754768213
417578638053970769383231564725
419329382358034771470357996213
420318014687166772648204655733
422094712453584774763614746368
425026887643230778251079577100
428739211895734782659902967253
429092492354170783079088821100
431992440015590786517582922476
432116561148820786664657632401
433558338646250788372482812501
433675985849820788511792272401
434410917820570789381886885100
438355000734334794046665759093
440240535006966796273987814613
441295538613266797519461212853
441509485897790797771967441525
443629541190516800272897833873
445464643662290802435911718476
449392821122640807060548409601
450903340202234808836919538028
452871346979770811149680327276
455237080752120813927441756225
456892774084150815869953543125
457103482621166816117072757068
460125702243034819659297578988
460133899006966819668899021013
461235415602960820958905310976
461856568334666821686106763733
462524467610584822467841771968
465120783916810825504771366101
466633724698240827273085337601
467505992986766828292126284748
468726010443034829716869365013
472398364506966834001546338988
473959291996640835820975129601
474840571614766836847740073548
476154565778230838378039007276
479705795407160842510205014976
480343252317666843251381478133
481255169212834844311380420108
482262019415970845481327284725
483153483153484846516846516848
484831515348484848465151684848
484848484848484848484848484848
490598949886540855152781388400
491114051999660855749416635025
496913702072516862459813197073
498254925658084864009778070033
498891352549890864745011086476
498908647649890864764989086476
501422003096000867667003109376
502571576858820868993536641776
503511327583000870077573890625
504635010665740871373344012400
507278767483630874420102366901
509805249719466877329266786988
509936171437016877479954401728
510040606330110877600151797900
511683110449016879490031761473
513290377340650881338407656876
514939876087084883234369842833
517928439250234886666965345173
519553443476784888532061382913
522915916912290892388353281525
524967850563660894739679844976
528153291011584898386993348608
528281056829080898533211313600
529100529100530899470899470901
530512829344234901086395104853
530901530901530901530901530901
531043801937260901693585156976
534382745495480905509615729600
536195835305520907580194310401
537701863896484909299267751953
541310582910484913415420321648
545838624410716918574127824913
547928726833180920953102238225
549487504438300922726406890001
550837474876080924261542315776
554259945841660928150867804400
554728861256916928683461017968
554820814160710928787892894101
554962192710334928948452847733
557662015026784932013378675713
560398681177516935117833774448
560820773750180935596448272401
561113176880916935927974873233
561664678558210936553196405900
563135191270666938219822279468
568842683701750944682318296876
569637140635834945581097858668
574386728191016950950493828673
575389380267430952083147205100
577169553738666954093416548693
578175519186820955229004047600
579963275309266957246402979253
580702438105534958080247018613
582947591728084960612037416593
584493199198516962354144329328
586504602907016964620263180353
588056658297984966368093257728
588569249466966966945195388588
589470465724084967959656021393
591546536108540970295748980976
596574472153120975948550374401
596617364252220975996743631600
598121763808484977686763820528
602511309414484982614465284753
605200246931516985630552396528
605350277812100985798781019376
605614731927416986095297349568
607460242840830988164049878901
609266062649284990187455861488
609849534761830990841051738901
611119230539410992263041977525
614022909133300995513456500625
617043153751570998892089939276
617165232033034999028606028588

[32 digits]
10003064726883903317179188133525
10436139431306903394888730666101
10493810131229843405144731422273
10851186358410163468237133221953
10964431479169843488068097928128
11003464202799003494885755990000
11072501311610843506922320862993
11085679436909843509216767697473
11313909445983003548796262890001
11649214161534003606418731560001
11980620958969843662782240946753
12087915137497303680909135147276
12261771759809403710159326323601
12324791929907663720725317873228
12838677347692663806178359992373
12961207033843703826373728686901
13081477620437343846131587423573
13335093776836663887588074527308
13449471682378903906194384273525
13575215752944663926586377546613
13678596100413403943302678364400
13692208514870903945500507542476
13840604808682343969411571427628
14062811403125204005051566300225
14193551726640404025931051670976
14684411468762664103745955904428
14705261477785844107031607996993
15272119976709844195771259558848
15316920240535164202737286231953
15518180919182344233948548292373
15678413443992844258701671307888
15944931528174004299690679869376
15955211141100804301267111755776
16748447164416204421939844526225
17025152053640164463598332974848
17025152946359844463598467025153
17444202420997664526279311094828
17723655091151664567815078246133
17859725745169504587965102536876
18292714296970504651768293936876
18515432613083004684404451110000
18594987571097664696032708445548
18945637728385904747105393578101
19236820909278504789297829143125
19266273130673104793554624089525
19409060370377664814164165770348
19706243158027664856912944665653
19848463819079804877302428479600
20180347238655904924714345561900
20438764693972344961471124185653
20455891283859164963902312297233
20803113776900845013063854076433
21106602011861605055837071814400
21116715108238405057259304985601
21494261887642845110214753666288
21963198547026205175617784495600
22743529310556405283579332758976
22792061278350845290259147859568
23083207992234845330248859515153
23261226125120845354630942797168
23288430101419665358352346319413
24085241385328345466829969115893
24118607969231405471350881908976
24618676540508505538905025956876
24779058463654705560492410489100
24960499298310905584869250978101
25126832338792345607174812025228
25161313047887345611793812215948
25518943395046665659603176464108
25906225474146305711177694426901
26298817823417665763253943087253
26532230741260105794119727994476
27030112449608905859725440666476
27337504817091665900075975217333
27550468950882165927963591741888
27706478557788905948358437293525
27756373088254165954874940617793
27931490313186605977722963164400
28143120444931806005287064638225
28319718988439846028248819042048
28709399479330806078790641564225
28869375677937346099490486776428
29429108672725166171696123873553
30349540515312006289712760549376
30701313807180346334589213362613
31682043474945606459068219366400
31694963245154406460701989433601
31714857635401306463217432806901
31884944029579166484708211421168
32093572025291806511032612321776
32287766820216706535500415621100
32360881437194666544703806217388
33333333333333346666666666666668
34399809513283906799505751066476
35037388302912206878486322862225
35984591864548606995248414540400
36626013876175167073942521730928
36871688773329167104006130578833
37287900211186667154842781835308
37546111781367847186321512453888
37546113218632167186321687546113
37757416962879007212048413590000
38007883406338607242504775051025
38219891194293347268252336244908
38396569114097007289686845910000
39344657508321207404368862556225
39562368930144847430624420854128
40089700823758347494100476050668
40819224056259847581643263950848
41130396577097107618890457474101
41330877796320167642858914729728
41357259293305347646011264433388
41606690558106667675796867432533
42579873492174307791683371279276
42988478897444667840189543410613
42998002068730907841319014538101
43270307871056307873595322571276
43501810108282347901005311683628
43527159201578107904005002729525
44251757893252667989614424969653
44480285997210808016560635406401
44529212128011668022326311951308
44863840350392708061729470792725
45000719058239168077831776895633
45761988223454168167226205088833
46152745586173348213008269665493
47143060520507168328729919556113
47715268851200608395399791947025
48233084069063208455612813817600
49226205973396208570787567006225
49535484788881308606574656713100
49744680358040168630759676718848
49761943872459848632754742961153
50294385254134848694230105940848
50377878086511668703860298253068
50606896006849008730262037380625
50651247304712908735372678938476
52002419474584848890721893451153
52138901824153348906377078163733
52499483191309708947705881669100
53215012938703009029584096699376
54309705286491309154515070146901
54365996511226709160928570718901
55504869715418349290466906279468
56096554737169669357605958308588
56107921018703909358894647826476
56954655667700849454786284732433
57203424930698509482918494256876
57384252008846669503356028003733
57545599547841609521583892454400
57545601452158409521584107545601
58363112583652809613825549081600
59926031408950169789653916927553
60705800781050849877132340195568
60766535041017849883939136292288
61384283635407009953119431099376
61580773868179169975103556866833

Contributors

  • Mark Jason Dominus presented the problem and same the initial optimization I came up with

  • Joe Zbiciak contributed the modulus congruence optimization

  • Phil Doroff from ServerCentral provided a fat box with 80 CPUs so I could run the 30 digit list in a reasonable time.

  • Sinan Ünür made everything really fast by using int128 math

  • Matthew Arcus

Other Readings