Each of M and N is a
nonnegative integer such that:
M
o Celsius = N
o 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.
Ignoring N<10 as a typo, did up to 1 million.
for fahr=0:1000000
celsius=(fahr-32)*5/9;
if celsius==floor(celsius)
f=factor(fahr); counted=0; prev=0;
pwrCt=[];
for i=1:length(f)
if f(i)~=prev
counted=counted+1;
pwrCt(counted)=1;
prev=f(i);
else
pwrCt(counted)=pwrCt(counted)+1;
end
end
g=gcd(sym(pwrCt));
if g>1
base=fahr^(1/g));
disp([celsius fahr base g])
end
end
end
finds the following non-negative values
[0, 32, 2, 5]
[1120, 2048, 2, 11]
[43385, 78125, 5, 7]
[72800, 131072, 2, 17]
[89455, 161051, 11, 5]
In each line the three numbers are: Celsius, Fahrenheit, the base of the power, and the perfect power, such as 161051 is 11^5.
A similar attempt with negative Fahrenheit temperatures fails, as the powers are all even, producing positive rather than negative values:
[-240, -400, 20, 2]
[-160, -256, 2, 8]
[-85, -121, 11, 2]
[-45, -49, 7, 2]
[-20, -4, 2, 2]
|
Posted by Charlie
on 2022-01-09 10:05:17 |