document.write( "Question 1208205: Find the last two digits of (1! + 2! + 3! + ... + 2024!)^2024 \n" ); document.write( "
Algebra.Com's Answer #846471 by ikleyn(52794)\"\" \"About 
You can put this solution on YOUR website!
.
\n" ); document.write( "Find the last two digits of (1! + 2! + 3! + ... + 2024!)^2024
\n" ); document.write( "~~~~~~~~~~~~~~~~\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "First idea is that we need to know the last two digits of the sum of factorials:\r\n" );
document.write( "only last two digits of this sum will determine the answer after taking the degree.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " 1! =       1\r\n" );
document.write( "\r\n" );
document.write( " 2! =       2\r\n" );
document.write( "\r\n" );
document.write( " 3! =       6\r\n" );
document.write( "\r\n" );
document.write( " 4! =      24\r\n" );
document.write( "\r\n" );
document.write( " 5! =     120\r\n" );
document.write( "\r\n" );
document.write( " 6! =     720\r\n" );
document.write( "\r\n" );
document.write( " 7! =    5040\r\n" );
document.write( "\r\n" );
document.write( " 8! =   40320\r\n" );
document.write( "\r\n" );
document.write( " 9! =  362880\r\n" );
document.write( "\r\n" );
document.write( "10! = 3628800\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "At this point, we may stop calculating factorials, because, OBVIOUSLY, all the following factorials will have\r\n" );
document.write( "at least two ending zeroes, so they do not make influence to the last two digits of the sum of factorials.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "The sum  1! + 2! + 3! + ... + 10!  is  4037913,  and the last two digits of this sum are \"13\".\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Hence, the last two digits of the sum  1! + 2! + 3! + ... + 2024!  are  \"13\",  too.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Now our task is to find the last two digits of  \"13%5E2024\".\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Below is the table of the last two digits of the terms  \"13%5Ek\",  from 1 to 21  (k = 1, 2, 3, . . . , 21).\r\n" );
document.write( "I calculated this table using Excel recursive formula  \"r%5B1%5D\" = 13,  \"r%5Bn%2B1%5D\" = \"MOD%2813%2Ar%5Bn%5D%2C100%29\".\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "This formula returns the two last digits of the terms  \"13%5Ek\" and does not perform other unnecessary calculations; \r\n" );
document.write( "it also maintains the participating numbers as short as needed, so there is no overflow.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "   1            13\r\n" );
document.write( "   2		69\r\n" );
document.write( "   3		97\r\n" );
document.write( "   4		61    <<<---===\r\n" );
document.write( "   5		93\r\n" );
document.write( "   6		9\r\n" );
document.write( "   7		17\r\n" );
document.write( "   8		21\r\n" );
document.write( "   9		73\r\n" );
document.write( "  10		49\r\n" );
document.write( "  11		37\r\n" );
document.write( "  12		81\r\n" );
document.write( "  13		53\r\n" );
document.write( "  14		89\r\n" );
document.write( "  15		57\r\n" );
document.write( "  16		41\r\n" );
document.write( "  17		33\r\n" );
document.write( "  18		29\r\n" );
document.write( "  19		77\r\n" );
document.write( "  20		1\r\n" );
document.write( "  21		13\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "I know for sure, that the sequence of last two digits is cyclic.\r\n" );
document.write( "My task is to determine the parameters of this cycle: its first term and its length.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "    How do I know that this sequence is cyclic ? - Because there are only 100 (or 99, in this case) possible\r\n" );
document.write( "    remainders of two digits, and inevitably they begin repeating. As soon as they start repeating, we will see the cycle.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "From the table, you see that the 21-th value 13 repeats the first value 13.  \r\n" );
document.write( "It means that the sequence of the last two digits is cyclic with the period of 21-1 = 20.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Then the number of full periods till the 2024 term is  2024 : 20 = something + remainder.\r\n" );
document.write( "\r\n" );
document.write( "We do not need to know the value of this \"something\", but only need to know the remainder, which is, obviously, 4.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "It means that the last two digits of  \"13%5E2024\"  are the 4-th term of the cycle in the table above, i.e. 61.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "ANSWER.  The last two digits of the number  (1! + 2! + 3! + ... + 2024!)^2024  are \"61\".\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "Solved.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "---------------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "This problem is intended for a Math circle/Math school advanced students.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "So I leave some obvious details of the solution without explanations, hoping that
\n" ); document.write( "the student is adequate to the problem and knows simple truths, that every such student must know.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "If you want to see other similar solved problems of this kind, look into the lessons\r
\n" ); document.write( "\n" ); document.write( "    - What is the last digit of the number a^n ? \r
\n" ); document.write( "\n" ); document.write( "    - Find the last three digits of these numbers \r
\n" ); document.write( "\n" ); document.write( "    - Find the last two digits of the number 3^123 + 7^123 + 9^123 \r
\n" ); document.write( "\n" ); document.write( "in this site.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "They are intended to provide basics for you and to make your horizon wider.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );