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 #786496 by ikleyn(52781)\"\" \"About 
You can put this solution on YOUR website!
.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "            Here is another  (\"elegant\")  solution,  which tutor @greenestamps wants to see\r
\n" ); document.write( "\n" ); document.write( "            (and you, probably,  too).\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The base for this solution is the same rule of divisibility by  9:\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "    The number is divisible by 9 if and only if the sum of its digits is divisible by 9.\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "The more general form of this rule is\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "    For any number, the remainder of dividing by 9 is the same as the remainder of dividing by 9 the sum of its digits.\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "For both forms,  see the lesson\r
\n" ); document.write( "\n" ); document.write( "    - Divisibility by 9 rule \r
\n" ); document.write( "\n" ); document.write( "in this site.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "It follows immediately from these rules, that the remainder of division the number L(m) by 9 \r\n" );
document.write( "is equal to the remainder of divisibility by 9 the number\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "    1 + 2 + 3 + . . . + 9 + 10 + 11 + 12 + . . . + 99 + 100 + 101 + 102 + . . . 999 + 1000 + 1001 + 1002 + . . . + the last 4-digit number m = \r\n" );
document.write( "\r\n" );
document.write( "    = the sum of the first \"m\" natural numbers = \"%28m%2A%28m%2B1%29%29%2F2\".\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "So, all we need is to check the remainder of dividing by 9 of several numbers of the form  \"%28m%2A%28m%2B1%29%29%2F2\",\r\n" );
document.write( "starting from m = 2021, 2022, 2023, 2024 . . . \r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "The table below (made using the function r = mod(N,9) of Excel) shows these remainders\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "    m                              2021    2022   2023  2024\r\n" );
document.write( "\r\n" );
document.write( "    r = \"mod%28%28m%2A%28m%2B1%29%29%2F2%2C9%29\"          6       3      1     0\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Thus that minimal value of \"m\" the problems is asking for is  2024.    ANSWER\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "Solved.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );