Let k be a positive integer. Bernardo and Silvia take turns writing and erasing numbers on a blackboard as follows: Bernardo starts by writing the smallest perfect square with k+1 digits. Every time Bernardo writes a number, Silvia erases the last k digits of it. Bernardo then writes the next perfect square, Silvia erases the last k digits of it, and this process continues until the last two numbers that remain on the board differ by at least 2. Let f(k) be the smallest positive integer not written on the board. For example, if k=1, then the numbers that Bernardo writes are 16,25,36,49, and 64, and the numbers showing on the board after Silvia erases are 1,2,3,4, and 6, and thus f(1)=5. What is the sum of the digits of f(2)+f(4)+f(6)+⋯+f(2016)?
Answer choices
Show solution
Solution
Take k=2j. The smallest perfect square with k+1 digits is 10k=(10j)2, and after Silvia erases, the numbers shown are ⌊10kn2⌋ for n=10j,10j+1,…
Put M=10k. A jump of at least 2 from n to n+1 requires (n+1)2−n2=2n+1>M, so write n=2M+m with m≥0. The case m=0 gives a jump of only 1, so the first larger jump has m≥1. Let A=⌊Mn2⌋ and B=⌊M(n+1)2⌋. Because M is divisible by 4,AB=4M+m+⌊Mm2⌋,=4M+m+1+⌊M(m+1)2⌋.
Therefore the first jump of at least 2 occurs at the first m for which m2<M≤(m+1)2. Since M=10j, this is m=10j−1. The last displayed value before the gap is 4M+10j−1, so the smallest missing integer is f(2j)=4102j+10j.
Summing over j=1,…,1008,j=1∑1008f(2j)=25j=0∑1007102j+10j=0∑100710j=2016 digits2525⋯25+1009 digits111⋯10. There are no carries, so the digit sum is 1008⋅(2+5)+1008⋅1=1008⋅8=8064.
Thus, the correct answer is E.