Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

An Integer Temperature Puzzle

  1. Apr 15, 2007 #1
    The other day, Mack was preparing a table consisting of integer Fahrenheit temperatures (F) which yields integer Celsius (C) equivalent upon conversion.

    He noted that F= 527 gave the corresponding C value as 275 and realized that, he could have simply moved the first digit in F to the end to obtain C.

    Mack has since been trying in vain to find the next larger F value with this property.

    Do the next larger F exist, and if so, what is that value?
     
  2. jcsd
  3. Apr 16, 2007 #2


    In the following I have assumed that only 3-digit temperatures
    are allowed. The outline of the proof looks as follows:
    1) Show that Celsius is divisible by 5
    2) Show that (Fahrenheit-32) is divisible by 9
    3) Show that the first digit of Fahrenheit is 5.
    4) Show that the sum of the last two digits of Fahrenheit is divisible by 9
    5) Finally show that the only possible Fahrenheit temperature is 527.

    ----------------------------------------------------

    The formula is Celsius = (Fahrenheit-32)*5/9
    or in short: C = (F-32)*5/9

    What conditions are given?

    CONDITION 1)
    Celsius is a 3-digit natural number, thus
    C = (c1 c2 c3) where c1,c2,c3 are the digits of the temperature C in Celsius

    CONDITION 2)
    Fahrenheit is also a 3-digit natural number, thus
    F = (f1 f2 f3) where f1,f2,f3 are the digits of the temperature F in Fahrenheit

    CONDITION 3)
    The "swap-condition" requires
    (f2 f3 f1) = (c1 c2 c3)

    CONDITION 4)
    f1 not equal to 0 => c3 not equal to 0 (follows from condition 3)
    c1 not equal to 0 => f2 not equal to 0 (follows from condition 3)

    CONDITION 5)
    If F> 527 => F > C
    (One can show, that F > C if F > -40)

    With these conditions set up, we start solving the problem.

    ----------------


    [size=+1]Theorem 1:[/size] (F-32) is divisible by 9.
    Proof:
    F is a natural number (and F>527)
    => (F-32)5 is a natural number

    We require C is a natural number.
    => (F-32)5/9 is a natural number (right hand side of equation at the top).
    This is only possible if (F-32) is divisible by 9.
    []

    We can write
    (F-32) = (f1 f2-3 f3-2)
    where f1, f2-3 and f3-2 are the first, second and last
    digits of (F-32).

    [size=+1]Conclusion 1:[/size] f1 + f2-3 + f3-2 is divisible by 9
    Proof:
    This follows from Theorem 1.
    []
    ---------------------------

    [size=+1]Theorem 2:[/size] C is divisible by 5.
    Proof:
    Rearranging the formula at the top yields:

    9/5 Celsius = Fahrenheit - 32
    or in short:
    9/5 C = (F-32)
    Since the right hand side is a natural number, the left hand side
    must also be a natural number. This is only possible if C is divisible by 5.
    []


    [size=+1]Conclusion 2:[/size] C is of the form (c1 c2 5)
    Proof:
    From Theorem 2 it follows that
    the last digit c3 of C must either be a 0 or a 5,
    so the general form for C will be:

    (i) (c1 c2 0)
    (ii) (c1 c2 5)

    Since c3 does not equal zero (see CONDITION 4), C must
    be of the form (ii), thus
    C = (c1 c2 5).
    []


    [size=+1]Theorem 3:[/size] f2 + f3 must be divisible by 9.
    Proof:
    From conclusion 1 we know that
    f1 + f2-3 + f3-2 is divisible by 9.

    We can rewrite this in terms of c1,c2,c3 by CONDITION 3:
    f1=c3
    f2=c1
    f3=c2
    Thus,
    c3 + c1-3 + c2-2 is divisible by 9
    We can further replace c3 by 5 (Conclusion 2):
    5 + c1-3 + c2-2 is divisible by 9

    => c1 + c2 is divisible by 9.
    => f2 + f3 is divisible by 9.
    []

    [size=+1]Conclusion 3:[/size] There is only one 3-digit number, namely 527 that fulfills the
    conditions mentioned in the problem.

    Proof:
    From conclusion 2 it follows:
    F has the form (5 f2 f3)

    From Theorem 3 it follows
    that possible values for F are:
    (5 0 9)
    (5 1 8)
    (5 2 7)
    (5 3 6)
    (5 4 5)
    (5 5 4)
    (5 6 3)
    (5 7 2)
    (5 8 1)
    (5 9 0)
    (5 9 9)

    Since F > C (see CONDITION 5), it follows:
    (f1 f2 f3) > (c1 c2 c3)
    In particular,
    f1 > c1 or f1 = c1
    Since c1=f2 we can write:
    f1 > f2 or f1 = f2.

    This reduces the possible values for F to:
    (5 0 9)
    (5 1 8)
    (5 2 7)
    (5 3 6)
    (5 4 5)
    (5 5 4)

    If F is even, then (F-32) is even
    => (F-32)5 has 0 as last digit (an even number times 5 has 0 as last digit)
    => c3=0
    but we already stated in Conclusion 2 that
    c3 = 5
    Thus, F cannot be even. This further reduces
    the possible values for F to:
    (5 0 9)
    (5 2 7)
    (5 4 5)
    From condition 4 (c2 does not equal 0) we can reduce
    the possible values for F to:

    (5 2 7)
    (5 4 5)

    Plugging in these two values into the equation at the top, yields:

    (i) F = 527
    => c = (527-32)*5/9 = 495*5/9 = 55*5 = 275
    This fulfills the swap condition.

    (ii) F = 545
    => C = (545-32)*5/9 = 513*5/9 = 57*5 = 285
    This does not fulfill the swap condition.

    We finally showed that the only number is F=527 fulfilling the problem's
    condition.

     
  4. Apr 17, 2007 #3
    It looks like this solution might exist, and the fahrenheit temperature would start with "5294117647058", but I can't figure out how to precisely narrow down this number if it exists. There's a specific range for every order of magnitude beyond 100 where the fahrenheit number gets *close* to the celcius number if you move the first digit to the rear:

    527 F => 275 C *exact*
    5279 F => 2915 C *too low*
    5297 F => 2925 C *too high*
    52925 F => 29385 C *too low*
    52943 F => 29395 C *too high*
    529403 F => 294095 C *too low*
    529421 F => 294105 C *too high*
    5294111 F => 2941155 C *too low*
    5294129 F => 2941165 C *too high*
    52941173 F => 29411745 C *too low*
    52941191 F => 29411755 C *too high*
    529411757 F => 294117625 C *too low*
    529411775 F => 294117635 C *too high*
    5294117633 F => 2941176445 C *too low*
    5294117651 F => 2941176455 C *too high*
    52941176465 F => 29411764685 C *too low*
    52941176483 F => 29411764695 C *too high*
    529411764695 F => 294117647035 C *too low*
    529411764713 F => 294117647045 C *too high*
    5294117647049 F => 2941176470565 C *too low*
    5294117647067 F => 2941176470575 C *too high*
    52941176470571 F => 29411764705855 C *too low*
    52941176470589 F => 29411764705865 C *too high*
    529411764705863 F => 294117647058795 C *too low*
    529411764705881 F => 294117647058805 C *too high*

    I wrote a script to sort-of bash away at this, but beyond this point, my program can't calculate it, because it starts getting into scientific notation which gets imprecise at the lower decimal places.

    So... there's definitely a pattern, and it looks like it MIGHT get there eventually, but I can't seem to prove one way or another that it really exists.

    [edit]Acha! It DOES exist! Of course, it's over 1 quintillion degrees, so from a physics perspective, "temperature" may no longer apply to any physical object heated that hot, but in theory, it exists! See below:

    5294117647058823527 F = 2941176470588235275 C

    For the record, here's a few more, it should be easy for Mack to derive his pattern:

    5294117647058823527
    52941176470588235294117647058823527
    529411764705882352941176470588235294117647058823527
    5294117647058823529411764705882352941176470588235294117647058823527
    52941176470588235294117647058823529411764705882352941176470588235294117647058823527
    529411764705882352941176470588235294117647058823529411764705882352941176470588235294117647058823527


    DaveE
     
    Last edited: Apr 17, 2007
  5. Apr 18, 2007 #4
    Below my new answer in white.

    Ok, in my former post I restricted F to a 3-digit number.
    However, I approached the problem again, but this time differently.
    I found a number for F, namely:

    F = 5294 1176 4705 8823 527

    Plugging this into the formula C = (F-32)*5/9 yields:

    C = 294 1176 4705 8823 5275

    which indeed resembles F as described in the problem.

    I will describe how I found the number later.
    It involved examining an expression if it is divisible by 17.
    I've done most of the calculations by hand, because
    the big numbers (10^19) couldn't be handled by calculators
    or math programs.
     
    Last edited: Apr 18, 2007
  6. Apr 18, 2007 #5
    Hello davee123,

    I'm glad to see that we have the same answer, lol.
    The rest of my text is in white as not to spoil the answer (please keep reading davee123).


    I see that you've written a program that can handle large numbers.
    I've got a formula for those numbers. Could you check with your
    program if my formula reproduces your numbers?

    The formula I derived:

    F = 1/17 * [ 9 * 10^{16k+3} - 41 ]

    Here the formula written in Latex.

    for k=0,1,2,3,4......
     
    Last edited: Apr 18, 2007
  7. Apr 18, 2007 #6
    Yep! They match up perfectly! I would be curious to see how you arrived at the answer, though.

    DaveE
     
  8. Apr 24, 2007 #7

    ssb

    User Avatar

    omg you guys are insane, just a letting you know. :-)
     
  9. May 16, 2007 #8
    Here is how I solved the problem:

    STEP 1:
    The connection between the temperature in Celsius and the temperature in Fahrenheit is expressed by

    the formula [tex]C = (F-32) \cdot \frac{5}{9}[/tex] where C and F are integers.

    [tex](F-32)[/tex] is an integer and must be divisible by 9, otherwise the right hand side of the formula is not an integer which contradicts C being an integer.

    Our formula can be manipulated to [tex]\frac{C}{5} = \frac{(F-32)}{9}[/tex].

    C must be divisible by 5 because
    [tex]\frac{(F-32)}{9}[/tex] is an integer. Let us manipulate the formula again: [tex]C=(\frac{F-32}{9})\cdot 5[/tex].
    We can conclude that C has 0 or 5 as last digit.

    Let us introduce a notation for the digits of C and F:
    [tex]C = (c_1 c_2 ... c_{n-1} c_n)[/tex] and [tex]F = (f_1 f_2 ... f_{n-1} f_n)[/tex] with [tex]c_1 \neq 0[/tex] and [tex]f_1 \neq 0[/tex].

    Now, the problem says: Moving the last digit of F to the end yields C,
    for example [tex]F=527[/tex] and [tex]C=275[/tex]. Let's call this a Swap, so in general we have
    [tex]Swap[F]= Swap[(f_1 f_2 ... f_{n-1} f_n)] = (f_2 ... f_{n-1} f_n f_1) [/tex]
    The swap condition means [tex]Swap[F] = C[/tex], thus [tex](f_2 ... f_{n-1} f_n f_1)=(c_1 c_2 ... c_{n-1} c_n)[/tex]

    We know that [tex]c_n = 0[/tex] or [tex]c_n = 5[/tex], thus [tex]f_1 = 0[/tex] or [tex]f_1 = 5[/tex]. But since
    [tex]f_1 \neq 0[/tex], it follows that [tex]f_1 = 5[/tex] and [tex]c_n=5[/tex].

    [tex]C = (c_1 c_2...c_{n-1} 5)[/tex]
    [tex]F = (5 f_2... f_{n-1} f_n)[/tex]

    -----------------------------------------------------------

    STEP 2
    We know from the swap condition that
    [tex]C = (f_2 f_3 ... f_{n-1} f_n 5)[/tex]
    Let us compare this with F:
    [tex]F = (5 f_2... f_{n-1} f_n)[/tex]
    We notice that the digits [tex](f_2 f_3 ... f_{n-1} f_n)[/tex] occur both in C and F. Let us make use of this:

    a) [tex](C-5) = (f_2 f_3 ... f_{n-1} f_n 0)[/tex]

    b) [tex]10F = (5 f_2 f_3 ... f_{n-1} f_n 0)[/tex]

    [tex]10F-5 \cdot 10^n = (f_2 f_3 ... f_{n-1} f_n 0) = (C-5)[/tex]
    [tex]\Rightarrow 10 F = 5 \cdot 10^n + (C-5)[/tex]

    We plug in the temperature formula for C:
    [tex]10F = 5 \cdot 10^n + (F-32) \cdot \frac{5}{9} - 5[/tex]

    [tex]\Rightarrow 10F = 5 \cdot 10^n + \frac{5}{9} F - 32 \cdot \frac{5}{9} - 5[/tex]

    [tex]\Rightarrow \frac{85}{9}F = 5 \cdot 10^n - \frac{205}{9}[/tex]

    [tex]\Rightarrow 85F = 45 \cdot 10^n - 205[/tex]

    [tex]\Rightarrow F = \frac{45}{85} \cdot 10^n - \frac{205}{85}[/tex]

    [tex]\Rightarrow F = \frac{9}{17} \cdot 10^n - \frac{41}{17}[/tex]

    We finally obtain

    [tex]\Rightarrow F = \frac{1}{17} ( 9 \cdot 10^n - 41)[/tex]
    The question is, for which values of n is F an integer. Does such a value for n even exist (besides the n for our example [tex]F=527[/tex])?
    In Step 3 and 4 we want to examine for which values of n the expression [tex](9 \cdot 10^n - 41)[/tex] is divisible by 17.

    ------------------------------------------------------

    STEP 3
    We already know that [tex]F=527[/tex] fulfills the swap condition. We obtain [tex]F=527[/tex] for [tex]n=3[/tex]:
    [tex]F = \frac{1}{17} (9 \cdot 10^3 -41) = \frac{1}{17} (9000 - 41) = \frac{1}{17}(8959) = 527[/tex]

    There is a rule for testing whether a number is divisible by 17, see
    here: http://www.egge.net/~savory/maths1.htm and http://primes.utm.edu/curios/page.php/17.html

    In order to illustrate the rule we test if 8959 is divisible by 17:
    Step 1: Split 8959 in 895 and 9 (last digit), multiply 9 (the last digit) by 5: [tex]9 \cdot 5 = 40[/tex].
    Step 2: Substract this from the ramaining digits 895: [tex]895-9\cdot5=850[/tex].
    Step 3: If the last two or three remaining digits are divisible by 17 then the original number 8959 is divisible by 17, too. In this case, 850 is divisible by 17, thus 8959 is divisible by 17, too.

    So, for [tex]n=3[/tex], F is an integer. What about [tex]n=4[/tex]:

    [tex]F = \frac{1}{17}(9 \cdot 10^4 -41) = \frac{1}{17}(90000-41) = \frac{1}{17}(89959)[/tex]

    Let's test if 89959 is divisible by 17:
    Step 1: [tex]8995-9\cdot 5 = 8955[/tex]
    Step 2: [tex]895 -5 \cdot 5 = 870[/tex]
    Step 3: 870 is not divisible by 17, so 89959 is not divisible by 17.

    Now, we could carry on with [tex]n=5[/tex]:
    [tex]F = \frac{1}{17}(9 \cdot 10^4 - 41) = \frac{1}{17} (89959)[/tex]

    Instead, before proceeding with steps 1 to 3 of the divisibility test, we observe the following:

    [tex]9 \cdot 10^n -41[/tex] has the following values for [tex]n=3,4,5,6,...[/tex]

    [tex]n=3: 9000-41 = 8959[/tex]

    [tex]n=4: 90000-41 = 89959[/tex]

    [tex]n=5: 900000-41 = 899959[/tex]

    [tex]n=6: 9000000-41 = 8999959[/tex]
    ...

    The number on the right hand side has the form [tex]899.....959[/tex].
    We can observe that the 9-digits increase with increasing n. We will use this
    in Step 4.

    (It follows Step 4 that might be difficult to understand but I'll try my best to explain it.)

    ---------------------------------------------------------------------

    STEP 4

    If we go through steps 1 to 3 of the divisibility test by 17, we can get
    from [tex]n=4[/tex] to [tex]n=5[/tex] by just putting a further 9-digit to the left. This means a shortcut because we can use the results from the (n=4)-test for the (n=5)-test. You will (hopefully) see what I mean:

    The number that has to be tested for divisibility by 17 has the form [tex]899.....959[/tex].
    We consider only the last digits 959 and start our test for divisibility by 17:

    [tex]n=3: 959 \rightarrow 95-9\cdot 5 = 50[/tex] (850 is divisible by 17)
    [tex]n=4: (50 \rightarrow) 950 \rightarrow 95-0 \cdot 5 = 95[/tex] (895 is not divisible by 17)
    [tex]n=5: (95 \rightarrow) 995 \rightarrow 99- 5 \cdot 5 = 74[/tex] (874 is not divisible by 17)

    Before we proceed, we write down the multiples of 17 from 800 to 899. List: 816, 833, 850, 867, 884.
    The reason is that we don't want to check each time whether the remaining 3-digits (850, 895, 874...) from our divisibility test are divisible by 17. Instead, we just check if the remaining 3-digits are in the list.

    [tex]n=6: (74 \rightarrow) 974 \rightarrow 97- 4 \cdot 5 = 77[/tex] (877 is not in our list)
    [tex]n=7: (77 \rightarrow) 977 \rightarrow 97- 7 \cdot 5 = 62[/tex] (862 is not in our list)
    [tex]n=8: (62 \rightarrow) 962 \rightarrow 96- 2 \cdot 5 = 86[/tex] (886 is not in our list)
    [tex]n=9: (86 \rightarrow) 986 \rightarrow 98- 6 \cdot 5 = 68[/tex] (868 is not in our list)
    [tex]n=10: (68 \rightarrow) 968 \rightarrow 96- 8 \cdot 5 = 56[/tex] (856 is not in our list)
    [tex]n=11: (56 \rightarrow) 956 \rightarrow 95- 6 \cdot 5 = 65[/tex] (865 is not in our list)
    [tex]n=12: (65 \rightarrow) 965 \rightarrow 96- 5 \cdot 5 = 71[/tex] (871 is not in our list)
    [tex]n=13: (71 \rightarrow) 971 \rightarrow 97- 1 \cdot 5 = 92[/tex] (892 is not in our list)
    [tex]n=14: (92 \rightarrow) 992 \rightarrow 99 - 2 \cdot 5 = 89[/tex] (889 is not in our list)
    [tex]n=15: (89 \rightarrow) 989 \rightarrow 98 - 9 \cdot 5 = 53[/tex] (853 is not in our list)
    [tex]n=16: (53 \rightarrow) 953 \rightarrow 95 - 3 \cdot 5 = 80[/tex] (880 is not in our list)
    [tex]n=17: (80 \rightarrow) 980 \rightarrow 98 - 0 \cdot 5 = 98[/tex] (898 is not in our list)
    [tex]n=18: (98 \rightarrow) 998 \rightarrow 99 - 8 \cdot 5 = 59[/tex] (859 is not in our list)
    [tex]n=19: (59 \rightarrow) 959 \rightarrow 95 - 9 \cdot 5 = 50[/tex] (850 is in our list!)

    So, for [tex]n=3[/tex] and [tex]n=19[/tex], the number [tex](9\cdot 10^n-41)[/tex] is divisible by 17. If we carry on the test
    for [tex]n=20,21,...[/tex] it is clear that after 16 steps, i.e. [tex]n=35[/tex], the remaining 3-digit will be 850 again.

    Thus, n has the form [tex]n=3+16k[/tex] with [tex]k=0,1,2,3,...[/tex]. Our final result for F is

    [tex] F = \frac{1}{17} (9 \cdot 10^{3+16k}-41) [/tex] with [tex]k=0,1,2,3...[/tex].

    For [tex]k=1[/tex] we get the value F = 5294 1176 4705 8823 527 (I had to calculate this by hand because the number is too big for the calculator). The corresponding value for C is obtained by plugging F
    into the formula [tex]C = (F-32) \frac{5}{9}[/tex]. We get C = 294 1176 4705 8823 5275.
    F = 5294 1176 4705 8823 527 and C = 294 1176 4705 8823 5275 obviously fulfill the swap condition.

    Note: Before I discovered that after 16 steps the remaining 3-digit is divisible by 17, I actually thought that F=527 is the only number that fulfills the swap condition. So, I was actually hoping for a remaining 3-digit (not in our list) to occur twice. For example, if for n=8 and n=13 the remaining 3-digit was 886, it would be clear that for n=18 the 3-digit 886 occured again. From this it would have followed that no remaining 3-digit was divisible by 17, thus F=527 would have been the only number that fulfilled the swap condition.
     
    Last edited: May 16, 2007
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: An Integer Temperature Puzzle
  1. A Division Puzzle (Replies: 0)

  2. An Examination Puzzle (Replies: 6)

  3. Superdokey puzzle (Replies: 4)

  4. Puzzle for you (Replies: 1)

  5. Ippossible puzzle? (Replies: 12)

Loading...