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

 Temperature Temperament (Posted on 2013-03-06)
Determine all possible values of a positive integer x satisfying:

x degrees Fahrenheit = sod(x) degrees Celsius, where sod(x) denotes the sum of the digits in the base ten expansion of x.

Prove that there are no others.

Note: To convert from degrees Fahrenheit to Celsius, subtract 32 then multiply by 5/9. To convert the other way, simply do the opposite (multiply by 9/5 and add 32).

 No Solution Yet Submitted by K Sengupta Rating: 2.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 program for solution (spoiler) | Comment 2 of 3 |

DECLARE FUNCTION sod! (x!)
FOR c = -100 TO 10000
f = c * 9 / 5 + 32
IF f = INT(f) THEN
IF c = sod(f) THEN
PRINT f, c
END IF
END IF
NEXT

FUNCTION sod (x)
s = 0
st\$ = LTRIM\$(STR\$(x))
FOR i = 1 TO LEN(st\$)
s = s + VAL(MID\$(st\$, i, 1))
NEXT
sod = s
END FUNCTION

`F             C41            5`

 Posted by Charlie on 2013-03-06 11:34:08

 Search: Search body:
Forums (0)