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

Home > Numbers
Number dilemma (Posted on 2019-06-05) Difficulty: 4 of 5
Find all 3-digit integers n (no leading zeroes) such that the sum of the squares of the digits of n is exactly one-half of n.

No Solution Yet Submitted by Danish Ahmed Khan    
Rating: 4.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 19
 
 For n = 100 To 999
   sumsq = 0
   ns$ = LTrim(Str(n))
   For i = 1 To Len(ns)
     sumsq = sumsq + Val(Mid(ns, i, 1)) * Val(Mid(ns, i, 1))
   Next
   If 2 * sumsq = n Then Text1.Text = Text1.Text & n & crlf
   DoEvents
 Next
 
finds 

298 is the only such number in the range of 3-digit numbers.

4+81+64 = 149 = 298/2

Outside the range, only 50 fits the bill.

  Posted by Charlie on 2019-06-05 12:29:13
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (20)
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