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

Home > Numbers
Some Digits Sum 37 (Posted on 2009-06-04) Difficulty: 2 of 5
Determine all possible positive base ten repdigit(s) N, such that the sum of the digits of N2 is equal to 37.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 4
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>99999999999999999999 then goto 120
  110      endloop
  120   next
  200   end
OK
run
 2222    4937284
 7777    60481729
OK

 

Since n^2 can't have more than 37 digits, n can't have more than 19, so the list is complete at (2222, 7777).


  Posted by Charlie on 2009-06-04 13:27:18
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (17)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information