document.write( "Question 1162656: The positive integers 1,2,3,4,...,m are written one after another to form the integer L = 123456789101112131415 . . .. What is the smallest integer m > 2020 for which L is divisible by 9? \n" ); document.write( "
Algebra.Com's Answer #786492 by greenestamps(13200)\"\" \"About 
You can put this solution on YOUR website!


\n" ); document.write( "(1) A number is divisible by 9 if the sum of its digits is divisible by 9.

\n" ); document.write( "(2) We can ignore the 0's in the number, since they add nothing to the sum of the digits.

\n" ); document.write( "(3) The number 123456789 is divisible by 9, because the sum of the digits is 45, which is divisible by 9.

\n" ); document.write( "So the number L is divisible by 9 through m=9.

\n" ); document.write( "(4) In the number 101112...979899, the digits 1 through 9 are each used the same number of times, so the sum of the digits is a multiple of the sum of the digits 1 through 9, which is divisible by 9.

\n" ); document.write( "So the number 101112...979899 is divisible by 9; and so the number L through m=99 is divisible by 9.

\n" ); document.write( "(5) The same argument holds for the number 100101102...997998999 -- each digit 1 through 9 is used the same number of times, so the number 100101102...997998999 is divisible by 9.

\n" ); document.write( "So the number L through m=999 is divisible by 9.

\n" ); document.write( "(6) For the number 100010011002...199719981999, we again have the same digits as in the number 123456789101112...997998999, plus we have 1000 1's. Those 1000 1's have a sum of 1000, which is 1 more than a multiple of 9.

\n" ); document.write( "So the number L through m=1999 has remainder 1 when divided by 9.

\n" ); document.write( "From here, it looks as if we need to go one more number m at a time in order to find the first one larger than 2020 for which the integer L is divisible by 9.

\n" ); document.write( "(perhaps another tutor will respond showing an easier way to get from here to the answer -- or perhaps to solve the whole problem more easily)

\n" ); document.write( "We start knowing that through m=1999 the integer L has remainder of 1 when divided by 9 -- i.e., L = 1 mod 9.

\n" ); document.write( "We go from there, remembering that we are looking for the first m greater than 2020 for which L is divisible by 9....
\r\n" );
document.write( "   m added\r\n" );
document.write( "      sum   L mod 9\r\n" );
document.write( "  -------------------\r\n" );
document.write( "  2000  2   3\r\n" );
document.write( "  2001  3   6\r\n" );
document.write( "  2002  4   10 = 1\r\n" );
document.write( "  2003  5   6\r\n" );
document.write( "  2004  6   12 = 3\r\n" );
document.write( "  2005  7   10 = 1\r\n" );
document.write( "  2006  8   9 = 0\r\n" );
document.write( "  2007  9   9 = 0\r\n" );
document.write( "  2008 10  10 = 1\r\n" );
document.write( "  2009 11  12 = 3\r\n" );
document.write( "  2010  3   6\r\n" );
document.write( "  2011  4  10 = 1\r\n" );
document.write( "  2012  5   6\r\n" );
document.write( "  2013  6  12 = 3\r\n" );
document.write( "  2014  7  10 = 1\r\n" );
document.write( "  2015  8   9 = 0\r\n" );
document.write( "  2016  9   9 = 0\r\n" );
document.write( "  2017 10  10 = 1\r\n" );
document.write( "  2018 11  12 = 3\r\n" );
document.write( "  2019 12  15 = 6\r\n" );
document.write( "  2020  4  10 = 1\r\n" );
document.write( "  2021  5   6\r\n" );
document.write( "  2022  6  12 = 3\r\n" );
document.write( "  2023  7  10 = 1\r\n" );
document.write( "  2024  8   9 = 0


\n" ); document.write( "ANSWER: m=2024 is the smallest integer greater than 2020 for which L is divisible by 9.

\n" ); document.write( "Note that, from the pattern of L mod 9 for m from 2000 to 2020, we could have predicted the answer; but since the period of the pattern is relatively short it was just as easy to continue with the table.

\n" ); document.write( "Cool problem....

\n" ); document.write( "I will be looking to see if another tutor has an elegant way of finding the answer with less effort.

\n" ); document.write( "-----------------------------------------------------------

\n" ); document.write( "Thanks to tutor @ikleyn for showing a much easier path to the answer to the problem....

\n" ); document.write( "
\n" ); document.write( "
\n" );