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 occurred 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.