1 1 . What is the longest possible length of a lucky chain?
A lucky chain is a sequence of consecutive positive integers, each of which has a digit sum that is not a multiple ofThe sequence does not need to start from 1.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Perfect. (Although it took me a second to understand why the second sentence was true.)
Thanks!
I would really love a good solution for this.
I tried it this way:
If we start from '1', we can reach only up to 28, before the sum of digits is a multiple of 11 Now, if we take any 2 successive numbers whose digit sum is a multiple of 11, the difference would be 9 Comparing the highest such 2 digit number and the least 3 digit number, viz. 92 and 119, the difference is 27, so 26 numbers in between
This is when I realized, the largest sequence will be formed between the highest n-digit number and the least (n+1)-digit number, whose digit sum is a multiple of 11
Now, if we test few highest n-digit numbers:
If, we observe the 5th number, this has the last two digits as 80
Now, the least (n+1)-digit number whose digit sum is a multiple of 11 are always of the form:
As, the last two digits are always same, this will not play a deciding factor.
So the maximum difference is for 1000019 - 999980 = 39
As, the difference is 39, there must be 3 8 numbers in between
PS: I cross checked each of the highest n-digit numbers, and found a repetitive pattern
The last two digits form a cycle ...
That's a good start to understanding the problem. Think about the 4 different techniques which I introduced. Which one is applicable in this instance?
Please note the problem statement, it says consecutive integers, Which means the numbers might be negative and zero as well, Therefore, The solution should be 57. [-28,28]
0 is a multiple of 11, so your string does not work.
Typically, we don't talk about digit sums for negative numbers. For clarity, I will add the word positive into the question.
Here's how I sort of confidently arrived at the correct answer.
We focus on the main property of the numbers in the sequence: Consecutive numbers.
Denote k ( n ) the sum of the digits of n excluding its units digit in ( m o d 1 1 ) .
When a sequence contains all 1 0 consecutive numbers with the same tens digit:
i.e. in ( m o d 1 1 ) : k ( i ) + 0 , k ( i ) + 1 , . . . , k ( i ) + 9 where i is the first number.
Since none of the numbers is ≡ 0 ( m o d 1 1 ) , therefore it must be ture that k ( i ) ≡ 1 . If we continue the sequence, thereby increasing the tens digits by 1 (assuming that the tens digits is not 9 ), then k ( i + 1 0 ) ≡ 2 , where i + 1 0 is the first number with the new tens digit. This means the sequence can only go as far as to i + 1 8 since k ( i + 1 0 ) + 9 ≡ 2 + 1 1 ≡ 0 . Together we conclude that for a sequence of numbers that has the same hundreds digit, the longest length of such sequence is 1 0 + 9 = 1 9 .
Note that to lengthen our list to maximum, we could combine two sequences of numbers with two different hundreds digits. Base on our results from above, our maximum should be 1 9 × 2 = 3 8 , now we just have to find a satisfying sequence, which is not hard to do using our argument above.
The final paragraph is slightly wrong. Note that when you "combine two sequences", you also need to add the multiple of 10 that is between them, and your answer would thus be 39 instead.
Which of the 4 approaches which I outlined can you use in this problem?
Not sure if what I said was worded incorrectly and it would've helped if I provided an example. But I think I accounted for the multiple of 10 since it's part of the list of number that has the same hundreds digit.(note that in the 5th line of my solution I started the list with k ( i ) + 0 , a number with unit digit 0)
Ah, I see that you were conditioning on "numbers with the same hundreds digit".
My initial thought was that the first number in your sequence must start with 1, which is why I talked about "add the multiple of 10".
Problem Loading...
Note Loading...
Set Loading...
999981, ... , 1000018 is a lucky chain of length 38.
Now, for any positive integer n , let S ( n ) be the set { 1 0 n , . . . , 1 0 n + 9 } , and note that S ( n ) can only be contained in a lucky chain if the digit sum of n is ≡ 1 m o d 1 1 . But if a lucky chain of length 39 (or more) exists, it must contain S ( n ) ∪ S ( n + 1 ) ∪ S ( n + 2 ) for some positive integer n . This implies that n , n + 1 , n + 2 each have digit sum ≡ 1 m o d 1 1 , which in turn implies that the last digits of n , n + 1 are both 9, a contradiction.