The number 1987 can be written as a three digit number xyz in some base
b.
If x + y + z = 1 + 9 + 8 + 7=25, determine all possible values of x, y, z, b.
Source: 1987 Canadian Mathematical Olympiad.
Well, the only shortcut I saw was that 13<b<45 to give a three digit number with x non-zero. I tried by hand up to b=15 and then fell back to the computer. Base 19 held the answer:
5 9 11 base 19 adds to 25
I am painfully aware that these kids had no computers - so how did they limit the choices?
program zzz
do 2 i=13,45
ix=1987/i**2
is=1987-ix*i**2
iz=is-is/i*i
2 if(ix+is/i+iz.eq.25)print*,ix,is/i,iz,'base',i,' adds to 25'
end
rabbit-3:~ lord$ zzz
5 9 11 base 19 adds to 25
note, for x=0, looping up to base 2000, these work too:
rabbit-3:~ lord$ zzz
0 18 7 base 110 adds to 25
0 9 16 base 219 adds to 25
0 6 19 base 328 adds to 25
0 3 22 base 655 adds to 25
0 2 23 base 982 adds to 25
0 1 24 base 1963 adds to 25
Edited on October 17, 2018, 4:39 pm