Determine all possible positive base ten
repdigit(s) N, such that the sum of the digits of N
2 is equal to 37.
(In reply to
re: computer solution (a quibble) by Steve Herman)
list
10 for Rd=1 to 9
20 N=Rd
30 loop
40 N2=N*N:N2s=cutspc(str(N2))
45 T=0
50 for I=1 to len(N2s)
60 T=T+val(mid(N2s,I,1))
70 next
80 if T=37 then print N,N2
90 N=10*N+Rd
100 if N>9999999999999999999999999999999999999999999999 then goto 120
110 endloop
120 next
200 end
OK
run
2222 4937284
7777 60481729
OK
|
Posted by Charlie
on 2009-06-04 16:34:03 |