Given a positive base-10 positive integer N=anan−1…a1a0, let f(N)=2na0+2n−1a1+⋯+21an−1+20an. Find f(f(…f(20142014)…)) (20142014 applications of f).
Solution
Answer: 19
For positive N, f(N)>0. If N≥100, its highest digit index satisfies n≥2, and f(N)≤9(2n+2n−1+⋯+1)<9⋅2n+1<10n≤N.
If 20≤N<100, write N=10a1+a0, with a1≥2. Then f(N)=2a0+a1<10a1+a0=N. Repeated applications therefore decrease the value until it is between 1 and 19.
Also, if 19∣N, then 19∣f(N). Indeed, using 20≡1(mod19),
10nf(N)=j=0∑n10n2n−jaj≡j=0∑n10jaj=N(mod19).Since 2014=19⋅106, the starting value is divisible by 19, and every iterate remains divisible by 19. The only such positive value at most 19 is 19, which is fixed by f.