mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   Multiply Pandigital 2 (https://www.mersenneforum.org/showthread.php?t=17646)

 davar55 2013-01-07 02:24

Multiply Pandigital 2

What is the smallest positive integer n such that
both 2^n and 3^n are each singly pandigital, i.e.
contain all ten digits at least once? What about
doubly pandigital, i.e. contain each of all ten digits
at least twice? Care to try for three?

(Based on the "Multiply Pandigital" thread.)

 LaurV 2013-01-07 07:23

You imagine people have nothing to do and waste their time with trifles? :razz:

[CODE][COLOR=Orange](14:08:12) gp > [/COLOR]pandig(n)=v=[0,0,0,0,0,0,0,0,0,0];while(n>0,v[n%10+1]++;n\=10);return(vecsort(v)[1])
[COLOR=SeaGreen]%4 = [/COLOR][COLOR=DeepSkyBlue](n)->v=[0,0,0,0,0,0,0,0,0,0];while(n>0,v[n%10+1]++;n\=10);return(vecsort(v)[1])[/COLOR]
[COLOR=Orange](14:09:32) gp >[/COLOR] n=15; until(b>[B][COLOR=Red]0[/COLOR][/B]&&d>[B][COLOR=Red]0[/COLOR][/B],print(n++", "a=2^n", "b=pandig(a)" : "c=3^n", "d=pandig(c)))
16, 65536, 0 : 43046721, 0
17, 131072, 0 : 129140163, 0
18, 262144, 0 : 387420489, 0
19, 524288, 0 : 1162261467, 0
20, 1048576, 0 : 3486784401, 0
21, 2097152, 0 : 10460353203, 0
22, 4194304, 0 : 31381059609, 0
23, 8388608, 0 : 94143178827, 0
24, 16777216, 0 : 282429536481, 0
25, 33554432, 0 : 847288609443, 0
26, 67108864, 0 : 2541865828329, 0
27, 134217728, 0 : 7625597484987, 0
28, 268435456, 0 : 22876792454961, 0
29, 536870912, 0 : 68630377364883, 0
30, 1073741824, 0 : 205891132094649, 0
31, 2147483648, 0 : 617673396283947, 0
32, 4294967296, 0 : 1853020188851841, 0
33, 8589934592, 0 : 5559060566555523, 0
34, 17179869184, 0 : 16677181699666569, 0
35, 34359738368, 0 : 50031545098999707, 0
36, 68719476736, 0 : 150094635296999121, 0
37, 137438953472, 0 : 450283905890997363, 0
38, 274877906944, 0 : 1350851717672992089, 0
39, 549755813888, 0 : 4052555153018976267, 1
40, 1099511627776, 0 : 12157665459056928801, 0
41, 2199023255552, 0 : 36472996377170786403, 0
42, 4398046511104, 0 : 109418989131512359209, 0
43, 8796093022208, 0 : 328256967394537077627, 0
44, 17592186044416, 0 : 984770902183611232881, 0
45, 35184372088832, 0 : 2954312706550833698643, 1
46, 70368744177664, 0 : 8862938119652501095929, 0
47, 140737488355328, 0 : 26588814358957503287787, 1
48, 281474976710656, 0 : 79766443076872509863361, 1
49, 562949953421312, 0 : 239299329230617529590083, 0
50, 1125899906842624, 0 : 717897987691852588770249, 0
51, 2251799813685248, 0 : 2153693963075557766310747, 0
52, 4503599627370496, 0 : 6461081889226673298932241, 0
53, 9007199254740992, 0 : 19383245667680019896796723, 1
54, 18014398509481984, 0 : 58149737003040059690390169, 0
55, 36028797018963968, 0 : 174449211009120179071170507, 0
56, 72057594037927936, 0 : 523347633027360537213511521, 0
57, 144115188075855872, 0 : 1570042899082081611640534563, 1
58, 288230376151711744, 0 : 4710128697246244834921603689, 0
59, 576460752303423488, 0 : 14130386091738734504764811067, 0
60, 1152921504606846976, 0 : 42391158275216203514294433201, 1
61, 2305843009213693952, 0 : 127173474825648610542883299603, 2
62, 4611686018427387904, 0 : 381520424476945831628649898809, 1
63, 9223372036854775808, 0 : 1144561273430837494885949696427, 1
64, 18446744073709551616, 0 : 3433683820292512484657849089281, 1
65, 36893488147419103232, 0 : 10301051460877537453973547267843, 1
66, 73786976294838206464, 0 : 30903154382632612361920641803529, 0
67, 147573952589676412928, 0 : 92709463147897837085761925410587, 2
68, 295147905179352825856, 1 : 278128389443693511257285776231761, 0
69, 590295810358705651712, 0 : 834385168331080533771857328695283, 1
[B][COLOR=Red]70, 1180591620717411303424, 1 : 2503155504993241601315571986085849, 1[/COLOR][/B]

[COLOR=Orange](14:10:07) gp >[/COLOR] n=70; until(b>[COLOR=Red][B]1[/B][/COLOR]&&d>[COLOR=Red][B]1[/B][/COLOR],print(n++", "a=2^n", "b=pandig(a)" : "c=3^n", "d=pandig(c)))
71, 2361183241434822606848, 0 : 7509466514979724803946715958257547, 1
72, 4722366482869645213696, 0 : 22528399544939174411840147874772641, 1
73, 9444732965739290427392, 0 : 67585198634817523235520443624317923, 1
74, 18889465931478580854784, 0 : 202755595904452569706561330872953769, 1
76, 75557863725914323419136, 0 : 1824800363140073127359051977856583921, 2
77, 151115727451828646838272, 0 : 5474401089420219382077155933569751763, 2
78, 302231454903657293676544, 0 : 16423203268260658146231467800709255289, 2
79, 604462909807314587353088, 1 : 49269609804781974438694403402127765867, 1
80, 1208925819614629174706176, 0 : 147808829414345923316083210206383297601, 1
...
<snip: uninteresting (0,0) lines were skipped, due to size limit of the post>
...
82, 4835703278458516698824704, 1 : 1330279464729113309844748891857449678409, 1
83, 9671406556917033397649408, 0 : 3990838394187339929534246675572349035227, 1
84, 19342813113834066795298816, 1 : 11972515182562019788602740026717047105681, 0
85, 38685626227668133590597632, 0 : 35917545547686059365808220080151141317043, 2
86, 77371252455336267181195264, 0 : 107752636643058178097424660240453423951129, 2
87, 154742504910672534362390528, 1 : 323257909929174534292273980721360271853387, 1
[COLOR=Red][B]88, 309485009821345068724781056, 2 : 969773729787523602876821942164080815560161, 2[/B][/COLOR]

[COLOR=Orange](14:15:13) gp > [/COLOR]n=88; until(b>[COLOR=Red][B]2[/B][/COLOR]&&d>[COLOR=Red][B]2[/B][/COLOR],print(n++", "a=2^n", "b=pandig(a)" : "c=3^n", "d=pandig(c)))
89, 618970019642690137449562112, 1 : 2909321189362570808630465826492242446680483, 1
90, 1237940039285380274899124224, 0 : 8727963568087712425891397479476727340041449, 2
...
92, 4951760157141521099596496896, 0 : 78551672112789411833022577315290546060373041, 2
93, 9903520314283042199192993792, 0 : 235655016338368235499067731945871638181119123, 2
94, 19807040628566084398385987584, 1 : 706965049015104706497203195837614914543357369, 1
95, 39614081257132168796771975168, 1 : 2120895147045314119491609587512844743630072107, 2
96, 79228162514264337593543950336, 1 : 6362685441135942358474828762538534230890216321, 2
97, 158456325028528675187087900672, 1 : 19088056323407827075424486287615602692670648963, 2
98, 316912650057057350374175801344, 1 : 57264168970223481226273458862846808078011946889, 2
99, 633825300114114700748351602688, 0 : 171792506910670443678820376588540424234035840667, 2
100, 1267650600228229401496703205376, 1 : 515377520732011331036461129765621272702107522001, 0
101, 2535301200456458802993406410752, 1 : 1546132562196033993109383389296863818106322566003, 0
102, 5070602400912917605986812821504, 0 : 4638397686588101979328150167890591454318967698009, 1
103, 10141204801825835211973625643008, 1 : 13915193059764305937984450503671774362956903094027, 1
104, 20282409603651670423947251286016, 2 : 41745579179292917813953351511015323088870709282081, 0
105, 40564819207303340847894502572032, 1 : 125236737537878753441860054533045969266612127846243, 2
106, 81129638414606681695789005144064, 1 : 375710212613636260325580163599137907799836383538729, 0
107, 162259276829213363391578010288128, 0 : 1127130637840908780976740490797413723399509150616187, 2
108, 324518553658426726783156020576256, 0 : 3381391913522726342930221472392241170198527451848561, 2
109, 649037107316853453566312041152512, 1 : 10144175740568179028790664417176723510595582355545683, 3
110, 1298074214633706907132624082305024, 1 : 30432527221704537086371993251530170531786747066637049, 2
111, 2596148429267413814265248164610048, 1 : 91297581665113611259115979754590511595360241199911147, 1
112, 5192296858534827628530496329220096, 1 : 273892744995340833777347939263771534786080723599733441, 2
113, 10384593717069655257060992658440192, 2 : 821678234986022501332043817791314604358242170799200323, 2
114, 20769187434139310514121985316880384, 2 : 2465034704958067503996131453373943813074726512397600969, 2
115, 41538374868278621028243970633760768, 1 : 7395104114874202511988394360121831439224179537192802907, 1
116, 83076749736557242056487941267521536, 2 : 22185312344622607535965183080365494317672538611578408721, 2
117, 166153499473114484112975882535043072, 2 : 66555937033867822607895549241096482953017615834735226163, 4
118, 332306998946228968225951765070086144, 2 : 199667811101603467823686647723289448859052847504205678489, 3
119, 664613997892457936451903530140172288, 3 : 599003433304810403471059943169868346577158542512617035467, 2
120, 1329227995784915872903807060280344576, 2 : 1797010299914431210413179829509605039731475627537851106401, 2
121, 2658455991569831745807614120560689152, 1 : 5391030899743293631239539488528815119194426882613553319203, 1
122, 5316911983139663491615228241121378304, 1 : 16173092699229880893718618465586445357583280647840659957609, 4
123, 10633823966279326983230456482242756608, 1 : 48519278097689642681155855396759336072749841943521979872827, 2
124, 21267647932558653966460912964485513216, 1 : 145557834293068928043467566190278008218249525830565939618481, 3
125, 42535295865117307932921825928971026432, 2 : 436673502879206784130402698570834024654748577491697818855443, 3
126, 85070591730234615865843651857942052864, 2 : 1310020508637620352391208095712502073964245732475093456566329, 2
127, 170141183460469231731687303715884105728, 1 : 3930061525912861057173624287137506221892737197425280369698987, 2
128, 340282366920938463463374607431768211456, 1 : 11790184577738583171520872861412518665678211592275841109096961, 2
129, 680564733841876926926749214863536422912, 1 : 35370553733215749514562618584237555997034634776827523327290883, 3
130, 1361129467683753853853498429727072845824, 1 : 106111661199647248543687855752712667991103904330482569981872649, 4
131, 2722258935367507707706996859454145691648, 2 : 318334983598941745631063567258138003973311712991447709945617947, 2
132, 5444517870735015415413993718908291383296, 1 : 955004950796825236893190701774414011919935138974343129836853841, 3
[B][COLOR=Red]133, 10889035741470030830827987437816582766592, 3 : 2865014852390475710679572105323242035759805416923029389510561523, 4[/COLOR][/B]
[COLOR=Orange](14:15:34) gp >[/COLOR][/CODE]

 Batalov 2013-01-07 07:47

He must have been right!

 davar55 2013-01-07 20:23

Certainly don't want to trifle with this quick (very nice btw) solution to
the 1-ply 2-ply 3-ply pandigital problem. I was originally going to ask
not for 1, 2, and 3-ply but for 100-, 200-, and 300-ply pandigitals, but
now I see the problems scale easily that far.

I might have said 2^n-1 and 3^n-2 and all prime, but that's going
a bit too far, don't you think?

 All times are UTC. The time now is 08:49.