MathDB
Sum of all numbers possible by removing digits of n

Source: Indonesian Mathematics Olympiad 2011, Day 1, Problem 1

September 13, 2011
modular arithmeticnumber theory proposednumber theory

Problem Statement

For a number nn in base 1010, let f(n)f(n) be the sum of all numbers possible by removing some digits of nn (including none and all). For example, if n=1234n = 1234, f(n)=1234+123+124+134+234+12+13+14+23+24+34+1+2+3+4=1979f(n) = 1234 + 123 + 124 + 134 + 234 + 12 + 13 + 14 + 23 + 24 + 34 + 1 + 2 + 3 + 4 = 1979; this is formed by taking the sums of all numbers obtained when removing no digit from nn (1234), removing one digit from nn (123, 124, 134, 234), removing two digits from nn (12, 13, 14, 23, 24, 34), removing three digits from nn (1, 2, 3, 4), and removing all digits from nn (0). If pp is a 2011-digit integer, prove that f(p)āˆ’pf(p)-p is divisible by 99.
Remark: If a number appears twice or more, it is counted as many times as it appears. For example, with the number 101101, 11 appears three times (by removing the first digit, giving 0101 which is equal to 11, removing the first two digits, or removing the last two digits), so it is counted three times.