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

Home > Just Math
Perfect Powered Temperature (Posted on 2022-01-09) Difficulty: 3 of 5
Each of M and N is a nonnegative integer such that:

Mo Celsius = No Fahrenheit.

Determine all possible values of N<10 such that N is a perfect power.

*** F = (9/5)*C +32, where F denotes degree Fahrenheit and C denotes degree Celsius.

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 Solution | Comment 2 of 10 |
I think there must be a typo in the problem, because if M >= 0 and N >= 0 there are no such integers, let alone perfect powers.  For any Fahrenheit temp below 32, the Celsius value is negative.
So I tested Celsius values from -17 up to +10^7 degrees C.

 [(0, 32), 2],
 [(1120, 2048), 2],
 [(43385, 78125), 5],
 [(72800, 131072), 2],
 [(89455, 161051), 11],
 [(4660320, 8388608), 2]

----------
def c2f(n):
    if (n*9/5 + 32)%1 == 0:
        return int(n*9/5 + 32)
    else:
        return n*9/5 + 32
def f2c(n):
    if ((n-32)*5/9)%1 == 0:
        return int((n-32)*5/9)
    else:
        return (n-32)*5/9
def isPower(x,power=None):
    import math
    ans = [False, power]
    if x%1 != 0:
        return [False, power]
    limit = int(x**.5)
    for expo in range(2,limit +1):
        if (math.log(x,expo))%1 == 0:
            ans = [True,expo]
    return ans

ans = []
for cel in range(-17,10**7 ):
    fah = c2f(cel)
    if isPower(fah)[0]:
        ans.append([(cel, c2f(cel)), isPower(c2f(cel))[1]])
        print((cel, c2f(cel)), isPower(c2f(cel))[1])

Edited on January 26, 2025, 11:47 am
  Posted by Larry on 2022-01-09 10:17:05

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 (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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