Determine the probability that for a positive integer N drawn at random between 2 and 201 inclusively, the sum of the digits in the base N representation of 2011 (base ten) is a perfect square.
(In reply to
computer solution by Charlie)
There are 93 bases in all that satisfy the condition, the highest of course being base 2011, where the representation is 10. The stats at the bottom include the failure at base 2012, where the sole digit has the value 2011, which is not a square, but no higher bases, as those are all the same representation. If we add the failure at base-1 (2011 digits of 1 each), the denominator of the probability fraction would increase to 2012.
2 9 1 1 1 1 1 0 1 1 0 1 1
3 9 2 2 0 2 1 1 1
8 16 3 7 3 3
10 4 2 0 1 1
20 16 5 0 11
22 16 4 3 9
26 36 2 25 9
60 64 33 31
80 36 25 11
92 100 21 79
106 121 18 103
110 49 18 31
127 121 15 106
134 16 15 1
136 121 14 107
148 100 13 87
178 64 11 53
190 121 10 111
194 81 10 71
211 121 9 112
219 49 9 40
271 121 7 114
274 100 7 93
286 16 7 9
287 9 7 2
288 289 6 283
308 169 6 163
316 121 6 115
328 49 6 43
332 25 6 19
352 256 5 251
364 196 5 191
379 121 5 116
387 81 5 76
396 36 5 31
400 16 5 11
510 484 3 481
538 400 3 397
551 361 3 358
575 289 3 286
586 256 3 253
606 196 3 193
615 169 3 166
631 121 3 118
638 100 3 97
650 64 3 61
655 49 3 46
663 25 3 22
666 16 3 13
670 4 3 1
694 625 2 623
742 529 2 527
786 441 2 439
826 361 2 359
862 289 2 287
894 225 2 223
922 169 2 167
946 121 2 119
966 81 2 79
982 49 2 47
994 25 2 23
1002 9 2 7
1051 961 1 960
1112 900 1 899
1171 841 1 840
1228 784 1 783
1283 729 1 728
1336 676 1 675
1387 625 1 624
1436 576 1 575
1483 529 1 528
1528 484 1 483
1571 441 1 440
1612 400 1 399
1651 361 1 360
1688 324 1 323
1723 289 1 288
1756 256 1 255
1787 225 1 224
1816 196 1 195
1843 169 1 168
1868 144 1 143
1891 121 1 120
1912 100 1 99
1931 81 1 80
1948 64 1 63
1963 49 1 48
1976 36 1 35
1987 25 1 24
1996 16 1 15
2003 9 1 8
2008 4 1 3
2011 1 1 0
93 2011 93//2011 0.046245648930880159 21.6236559139784946236
5 dim Dig(20)
10 for N=2 to 2012
20 Sod=0:NumDigs=0
30 Num=2011
40 while Num>0
50 D=Num @ N:inc NumDigs:Dig(NumDigs)=D
60 Sod=Sod+D
70 Num=Num\N
80 wend
90 Sr=int(sqrt(Sod)+0.5)
100 if Sr*Sr=Sod then inc Psqrs
101 :print N,Sod,
102 :for I=NumDigs to 1 step -1
103 :print Dig(I);
104 :next:print
105 :if Psqrs @ 40=0 then while inkey="":wend:print
110 inc NCt
120 next N
130 print Psqrs,NCt,Psqrs//NCt,Psqrs/NCt,NCt/Psqrs
|
Posted by Charlie
on 2011-06-22 14:09:45 |