" "

Escaping elevens

Related

Share

From a Romanian Selection Test:
What is the greatest possible length of a sequence of consecutive positive integers, so that none of the integers have a digit sum divisible by 11?

You can actually get quite far starting with the number 1: you don’t run into trouble until you hit the number 29. After this, it appears to be quite difficult to get another run even close to this.
Given any stretch of positive integers where only the units digit changes, such as 450, 451, 452, …, 459, the digit sum always increases by 1 as we move from left to right. This makes it quite hard to avoid bad digit sums. To do so, we require the digit sum of the smallest integer in the stretch to be 1 more than a multiple of 11.
For example,
570, 571, 572, …, 579.
But for the next ten integers, the digit sums are all 1 greater than their counterparts among the first ten:
580, 581, 582, …, 589,
and now 589 has a bad digit sum.
This problem will occur most of the time. The only hope we have of avoiding it is initially having a 9 in the tens position, but even this might fail:
390, 391, 392, …, 399, … (all good so far)
…400, 401, …, 407 (oh dear).
What we really need is for both integers ending with a 0 (like 390 and 400 above) to have a digit sum 1 greater than a multiple of 11.
It turns out you have to look quite far:
999990, 999991, 999992, …, 999999, … (all good)
…, 1000000, 1000001, 1000002, …, 1000009 (still good).
Note that we have no hope of extending this sequence (or any similar sequence of length 20) to include all ten integers immediately before it, or all ten integers immediately after it – we’ll hit the same roadblock we had when considering 570-589 earlier.
But we can do the next best thing, and extend all the way down to 999981 and all the way up to 1000018.
Thus the best we can do is 38 integers,the smallest example of which is
999981, 999982, …, 1000018.
This is another one of my favourites – so little prerequisite knowledge, so far from obvious.