Teaser 2834: Degrees of freedom
From The Sunday Times, 15th January 2017 [link] [link]
I bought an odd thermometer from an old curiosity shop. On its linear scale the freezing point and boiling point of water were higher than they are on the centigrade scale. In fact the freezing point was a prime number and, higher up the scale, the boiling point was a perfect square. There was only one number on the scale where it actually agreed with the corresponding centigrade temperature. That number was the negative of an odd prime (and not the same prime as the one mentioned earlier).
On this new scale, what are the freezing and boiling points of water?
There are now 2500 puzzles available between the Enigmatic Code and S2T2 sites. See [link].
[teaser2834]





Jim Randell 8:46 am on 9 November 2021 Permalink |
A straightforward program finds the answer. The following Python program runs in 48ms.
Run: [ @replit ]
from enigma import (primes, irange, inf, div, printf) def solve(): # consider possible squares (for the boiling point) for n in irange(11, inf): b = n * n # consider possible primes (for the freezing point) for f in primes.between(2, b - 100): # compute when the temperature scales coincide d = b - f - 100 if not (d > 0): continue v = div(100 * f, d) if v is None or not (v > 2 and v != f and v in primes): continue yield (n, b, f, v) # find the first solution for (n, b, f, v) in solve(): printf("n={n} b={b} f={f} v={v}") breakSolution: The freezing point is at 41. The boiling point is at 961.
The scales coincide at −5.
To convert from Celsius you can use:
However, if the scales were allowed to coincide at −2, there would be further solutions:
A bit of analysis gives a shorter program:
The scales coincide at −v where:
And v is an odd prime number different from f.
The prime factorisation of the numerator is: 2 × 2 × 5 × 5 × f.
So we immediately see:
And a short program provides the answer:
from enigma import (primes, inf, is_square, printf) for f in primes.irange(2, inf): b = 21 * f + 100 if is_square(b): printf("f={f} b={b}") breakAlternatively, we can further analyse the expression for b, which is a square, say n²:
Considering the factor that does not contain f:
LikeLike