Almost The Hyperfactorial

K = n = 1 1001 n n K = \large \sum_{n=1}^{1001}n^n

Find the last digit of K K .

9 7 1 5 3

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.

7 solutions

Otto Bretscher
May 19, 2015

Note that ( n + 20 ) n + 20 n ( n + 20 ) n n ( m o d 10 ) (n+20)^{n+20}\equiv n^{(n+20)}\equiv n^n \pmod{10} for all positive n n ; we can reduce the exponent modulo 4 = ϕ ( 10 ) , 4=\phi(10), by Euler's Theorem. Thus the sequence n n ( m o d 10 ) n^n \pmod{10} has a period of 20. Let S = n = 1 20 n n S=\sum_{n=1}^{20}n^n . Since our sum runs through 1000 20 = 50 \frac{1000}{20}=50 periods, with one term n = 1001 n=1001 left over, we have n = 1 1001 n n 50 S + 100 1 1001 1 1 = 1 ( m o d 10 ) \sum_{n=1}^{1001}n^n\equiv50S+1001^{1001}\equiv1^1=\boxed{1}\pmod{10}

WOW short and neat! +1

Pi Han Goh - 6 years ago

So, that is how it is done. I realized there is a period for the last digit of n m n^m but did not know how to explain it.

Chew-Seong Cheong - 6 years ago

euler theorem works for the coprimes of 10 only here. for the others how I can be sure of period 20? I determined the period evaluating to 1 to 20. can you answer me? I am confused.

Ovishek Paul Ovi - 4 years, 4 months ago
Pi Han Goh
May 19, 2015

Consider the first forty terms and further split them into 4 partitioned sums:

S 1 = 1 1 + 2 2 + 3 3 + + 1 0 10 S 2 = 1 1 11 + 1 2 12 + 1 3 13 + + 2 0 20 S 3 = 2 1 21 + 2 2 22 + 2 3 23 + + 3 0 30 S 4 = 3 1 31 + 3 2 32 + 3 3 33 + + 4 0 40 \begin{aligned} S_1 &=& 1^1 + 2^2 + 3^3 + \ldots + 10^{10} \\ S_2 &=& 11^{11} + 12^{12} + 13^{13} + \ldots + 20^{20} \\ S_3 &=& 21^{21} + 22^{22} + 23^{23} + \ldots + 30^{30} \\ S_4 &=& 31^{31} + 32^{32} + 33^{33} + \ldots + 40^{40} \\ \end{aligned}

We further define S n = ( 10 n 9 ) 10 n 9 + ( 10 n 8 ) 10 n 8 + + ( 10 n ) 10 n S_n = (10n-9)^{10n-9} + (10n-8)^{10n-8} + \ldots + (10n)^{10n} .

Consider modulo 10 10 , the last digit of a b a^b is simply ( a m o d 10 ) b m o d 4 ( a \bmod {10} )^{b \ \bmod 4 } and with a little bit of modular arithmetic, we can easily see that

S 1 S 5 S 9 S 97 7 S 2 S 6 S 10 S 98 7 S 3 S 7 S 11 S 99 7 S 4 S 8 S 12 S 100 7 \begin{aligned} S_1 & \equiv & S_5 \equiv S_9 \equiv \ldots \equiv S_{97} \equiv 7\\ S_2 & \equiv & S_6 \equiv S_{10} \equiv \ldots \equiv S_{98} \equiv 7\\ S_3 & \equiv & S_7 \equiv S_{11} \equiv \ldots \equiv S_{99} \equiv 7\\ S_4 & \equiv & S_8 \equiv S_{12} \equiv \ldots \equiv S_{100} \equiv 7 \\ \end{aligned}

Hence, the summation in question is congruent to

n = 1 1001 n n = ( S 1 + S 2 + S 3 + + S 100 ) + 100 1 1001 100 ( 7 ) + 1 1 \begin{aligned} \displaystyle \sum_{n=1}^{1001} n^n & = & (S_1 + S_2 + S_3 + \ldots + S_{100} ) + 1001^{1001} \\ & \equiv & 100(7) + 1 \equiv \boxed 1 \end{aligned}

Just found a simpler solution after typing this out:

Consider grouping the terms as such

R 1 = { 1 1 , 1 1 11 , 2 1 21 , , 99 1 991 } R 2 = { 2 2 , 1 2 12 , 2 2 22 , , 99 2 992 } R 3 = { 3 3 , 1 3 13 , 2 3 23 , , 99 3 993 } R 9 = { 9 9 , 1 9 19 , 2 9 29 , , 99 9 999 } \begin{aligned} R_1 &=& \{ 1^1, 11^{11}, 21^{21}, \ldots , 991^{991} \} \\ R_2 &=& \{ 2^2, 12^{12}, 22^{22}, \ldots , 992^{992} \} \\ R_3 &=& \{ 3^3, 13^{13}, 23^{23}, \ldots , 993^{993} \} \\ & \ldots & \\ R_9 &=& \{ 9^9, 19^{19}, 29^{29}, \ldots , 999^{999} \} \\ \end{aligned}

Consider modulo 10 10 like above

R 1 { 1 1 , 1 11 , 1 21 , , 1 991 } R 2 { 2 2 , 2 12 , 2 22 , , 2 992 } R 3 { 3 3 , 3 13 , 3 23 , , 3 993 } R 9 { 9 9 , 9 19 , 9 29 , , 9 999 } \begin{aligned} R_1 &\equiv& \{ 1^1, 1^{11}, 1^{21}, \ldots , 1^{991} \} \\ R_2 &\equiv& \{ 2^2, 2^{12}, 2^{22}, \ldots , 2^{992} \} \\ R_3 &\equiv& \{ 3^3, 3^{13}, 3^{23}, \ldots , 3^{993} \} \\ & \ldots & \\ R_9 &\equiv& \{ 9^9, 9^{19}, 9^{29}, \ldots , 9^{999} \} \\ \end{aligned}

Note that the odd terms of each R n R_n are congruent to each other, for example 1 1 2 1 21 4 1 41 98 1 981 1^1 \equiv 21^{21} \equiv 41^{41} \equiv \ldots \equiv 981^{981} ; that goes for the even terms as well. Thus the paired sum must be divisible by 100 2 = 50 \frac{100}2 = 50 .

Hence for some integer k k , the summation in question must be of the form n = 1 1001 n n = [ n = 1 1000 n n ] + 100 1 1001 50 k + 1 1 . \displaystyle \sum_{n=1}^{1001} n^n = \left [ \sum_{n=1}^{1000} n^n \right ] + 1001^{1001} \equiv 50k + 1 \equiv \boxed1 .

Pi Han Goh - 6 years ago

Log in to reply

Yes, this solution is very similar to mine...we think alike (sometimes)

Otto Bretscher - 6 years ago

Log in to reply

Hehe thanks!

Don't mean to change the subject but do you have a smart way to solve this ? All I can think of is: "Is it 1? No. Is it 2? No. Is it 3?? No. yadda yadda yadda. Is it (answer)? Yes!

Pi Han Goh - 6 years ago

Log in to reply

@Pi Han Goh I'm not sure I have a "smart" way, but I sure have a systematic way, the way I approach most congruency problems unless I have a better idea: Factor 25725 and do the problem separately for each prime power factor: 3, 25, and 343. In each case, there are two subcases to consider: p divides a or it doesn't. I hope that helps...

Otto Bretscher - 6 years ago

Careful and lucid explanation, as we have come to expect from you...thanks!

Otto Bretscher - 6 years ago
Lee Isaac
Jun 3, 2015

Consider if the number on top of sigma is 1000. The sum of n=1 to n=10 ends with a 7. So does the sum of n=11 to 20 and...... and the sum of 991 to 1000.

100*7=700, which ends with 0. So the last digit of the sum of when n=1 to n=1000 is 0

Now 1001^1001 obviously ends with a 1.

1+0=1.

Gustavo Alves
Jun 12, 2015

As it ask for the last digit I focused on that. We know that 1^2, always ends in 1, 2^2 in 4, so the sequence is: 1,4,9,6(16), 5(25), 6(36) ,9(49), 4(64), 1(81), 0 (10). If we sum the last digits it will end at 5 (45). If we do it 1000 times it will end in 0, plus the last 1 (1001), that will end in 1.

Tim Lister
May 21, 2015

I just looked at the first 10 values of n and focused on the last digits. I manually worked out the last digits would be 1,4,7,4,5,6,3,6,9,0, which add to 5. (I noticed the symmetry and number bonds so feel there was a way of doing this work quicker) but then 11^11 until 20^20 would have the same last digits so wold also equal 5. This would repeat until 1000, so I wold have 200 sets of numbers with last digits of 5. These added make last digit of 0 then +1 for 1001^1001 term. similar to other methods but interesting that most people went for sets of 20 and I went sets of 10.

You have the right idea, looking for periodicity, but your solution has some issues. There is a mistake in your total from 1 to 10... 4 4 = 256 4^4=256 ends in a 6, so that the total is 7. Also, and more importantly, you don't get the same digits between 10 and 20... we have a period of 20, but not of 10 (see my solution).

Otto Bretscher - 6 years ago

I did the exact same trick but i still yield with 5 as the last digit. I've still not understood the formula explained by Mr Bretscher.

Ðeepanshu Kumar - 6 years ago

Log in to reply

Which part(s) don't you understand? I will be glad to (try to) explain.

Otto Bretscher - 6 years ago

Log in to reply

First of all, i need to study Euler's formula. I am not much familier with that. And if i encouter any problem, i may seek for your help.

Ðeepanshu Kumar - 6 years ago
Matt Kemp
Oct 15, 2020

Each last digit besides one will be summed 100 times. Out of these: 9, 5, 6, 0 have repeating last digit in there power sequences. So the sum of these powers will be: 100 9,5,6,0 which will have no effect on our summnations last digit since 100 n’s last digit will be zero for all integer ns. 4, 7, 3, 2, 8 have repeating last digit power sequence some even number apart , ex: 3, 9, 27, 81, 243... 4, 16, 64, 256... 7, 49, xx3, xxx1, xxxx7... 2, 4, 8, 16, 64, 32... 8, 64, 512, 4096, xxxx8

For n^n a number with the samelast digit will occur ever 10 away, ex: 3^3, 13^13, 23^23... So the next number with the same last digit will be two reapeats away + 2 for 3,7,2,8 since these repeat their last digit every 4 away (2 4)+2. Since the third number with the same last digit will be 2 ((2 4)+2) away we get (4 4)+4 so the pattern will repeat every two this is a multiple of 4. So from 1-1001 we will have 2 last digits appear 50 times each for 3,7,2,8: 50*n will always have a last digit of 0 for all integers so these numbers do no effect our summnations last digit.

4 will have the same last digit of 6 in n^n for all numbers since it’s power last digit pattern repeats every 2 and every n with a last digit of 4 is 10 away from each other, and 10 is a multiple of 2: 2 5. So all n with a last digit of 4 will have the same last digit of n^n and theses numbers will appear 100 times between 1-1001 so the amount 4 effects the last digit of our summnation is 100 n which will have a last digit of 0 for all integers n. So it wont effect our summnations last digit.

We have shown that all numbers with last digit 2-9 will not effect the above summnations fibal digit. So, only numbers with a last digit of 1 will effect out summnations last digit. Numbers with the last digit 1 will appear 101 times between 1-1001. So it will effect our summnations last digit by the last digit of 101*1 which is equal to 1. So our summnations last digit must be 1

Brock Brown
May 20, 2015

Python 2.7:

1
print str(sum([n**n for n in xrange(1,1002)]))[-1]

This is very cheat.

Angel Raygoza - 1 year, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...