All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Some digits sum square II (Posted on 2011-10-29)
Determine the probability that for a positive integer N drawn at random between 3 and 202 inclusively, the sum of the digits in the base ten representation of 2011 (base N) is a perfect square.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution Comment 1 of 1
`N               digits                sum  sq root3             2  2  0  2  1  1  1     9     38             3  7  3  3              16    410            2  0  1  1              4     220            5  0  11                16    422            4  3  9                 16    426            2  25  9                36    660            33  31                  64    880            25  11                  36    692            21  79                  100   10106           18  103                 121   11110           18  31                  49    7127           15  106                 121   11134           15  1                   16    4136           14  107                 121   11148           13  87                  100   10178           11  53                  64    8190           10  111                 121   11194           10  71                  81    9`

There are 18 bases out of the 200, so the probability is 9%.

DEFDBL A-Z
CLS

FOR n = 3 TO 202
digs = 0
num = 2011
tot = 0
DO
d = num MOD n
tot = tot + d
num = num \ n
dig(digs) = d
digs = digs + 1
LOOP UNTIL num = 0
sr = INT(SQR(tot) + .5)
IF sr * sr = tot THEN
PRINT n,
FOR i = digs - 1 TO 0 STEP -1
PRINT dig(i);
NEXT
PRINT TAB(39); tot; TAB(45); sr
ct = ct + 1
END IF
NEXT n
PRINT ct

 Posted by Charlie on 2011-10-29 14:12:01

 Search: Search body:
Forums (0)