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

Home > Just Math
Celsius Fahrenheit Check (Posted on 2015-01-13) Difficulty: 3 of 5
S(x) denotes the sum of squares of the digits. For example:
S(97) = 92 + 72 = 130.

Find all possible positive integer values of N < 2014 such that:
N oF= (S(N) - 5) oC

N.B.: F = (9/5)*C + 32

*** As an extra challenge, solve this puzzle using a non computer program assisted method.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution not taking up the extra challenge--(spoiler) Comment 1 of 1
Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 
 For n = 1 To 2014
   rhs = (sosqd(n) - 5) * 9 / 5 + 32
   If rhs = n Then
     Text1.Text = Text1.Text & n & Str(sosqd(n)) & Str(rhs) & crlf
   End If
 Next
 
 Text1.Text = Text1.Text & "done"
 
End Sub

Function sosqd(n)
  s$ = LTrim(Str(n))
  tot = 0
  For i = 1 To Len(s$)
   tot = tot + Val(Mid(s$, i, 1)) * Val(Mid(s$, i, 1))
  Next
  sosqd = tot
End Function

finds

185 90 185

N is 185, which is 85°C, having subtracted 5 from the sum of the squares of the digits, which is 90.

That's the only solution.

  Posted by Charlie on 2015-01-13 14:38:01
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 (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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