Nine is the key

Let f ( x ) f(x) denote the sum of digits of integer x x . Find the value of f ( f ( f ( 5 10000 ) ) ) f(f(f(5^{10000}))) .

As an explicit example, f ( 5 3 ) = f ( 125 ) = 1 + 2 + 5 = 8 f(5^3) = f(125) = 1 + 2 + 5 =8 .


The answer is 4.

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.

4 solutions

Proposition.- n f ( n ) ( m o d 9 ) {n} \equiv {f(n)} \pmod{9} for each n natural number

Proof.- Let

n = a b c d e = e + 10 d + 100 c + 1000 b + 10000 a n= abcde = e + 10d + 100c + 1000b + 10000a

f ( n ) = a + b + c + d + e 9 \Rightarrow f(n) = a + b + c +d + e \Rightarrow 9 |

n f ( n ) = 9 d + 99 c + 999 b + 9999 a . n - f(n) = 9d + 99c + 999b + 9999a.

This reasoning can be generealized...Q.E.D

So 5 10000 f ( 5 10000 ) ( m o d 9 ) 5^{10000} \equiv {f(5^{10000})} \pmod{9} .

5 10000 5^{10000} = ( 5 4 ) 2500 4 2500 ( m o d 9 ) (5^{4})^{2500} \equiv {4^{2500}} \pmod9 \Rightarrow 4 2500 4^{2500} = 4 ( 4 3 ) 833 4 1 833 4 ( m o d 9 ) {4 \cdot (4^{3})^{833}} \equiv {4 \cdot 1^{833}} \equiv 4 \pmod{9} \Rightarrow 5 10000 4 ( m o d 9 ) 5^{10000} \equiv 4 \pmod{9} .

Since 5 10000 5^{10000} has at most 9999 digits and 9 9999 9 \cdot 9999 =89991, 1< f( 5 10000 5^{10000} ) < 89991 < 99999, so f( 5 10000 5^{10000} ) has at most 5 digits \Rightarrow 1 < f(f( 5 10000 5^{10000} )) < 45, ( f(f( 5 10000 5^{10000} )) \equiv 4 (mod 9) ) \Rightarrow f(f( 5 10000 5^{10000} )) = 4, 13, 22, 31 or 40( They add all the same) \Rightarrow f(f(f( 5 10000 5^{10000} ))) = 4

Great proof!

Julian Poon - 5 years, 7 months ago

Yup! You just proved the divisibility rule of 9.

Pi Han Goh - 5 years, 7 months ago

Log in to reply

Is my proof about this problem wrong?

Guillermo Templado - 5 years, 7 months ago

Log in to reply

Needs a little bit of formatting but it's alright!! Thanks!

Pi Han Goh - 5 years, 7 months ago
Dev Sharma
Nov 6, 2015

According to the question we need to find sum of 5 n 5^n three times. Let us observe the pattern of sum three times :

5 1 = 5 5^1 = 5

5 2 = 7 5^2 = 7

5 3 = 8 5^3 = 8

5 4 = 4 5^4 = 4

5 5 = 2 5^5 = 2

5 6 = 1 5^6 = 1

5 7 = 5 5^7 = 5

we found that its cyclicity is 6,

so answer is 4

I don't understand why it has to cycle, and even if it cycles m o d 10 \mod{10} , what this solution is missing is to show that f ( f ( f ( 5 10000 ) ) ) f(f(f(5^{10000}))) is a single digit number.

Julian Poon - 5 years, 7 months ago

Log in to reply

Exactly my point.

Sharky Kesa - 5 years, 7 months ago

How do we know the answer is not 13? 13 4 ( m o d 9 ) 13 \equiv 4 \pmod{9} .

Sharky Kesa - 5 years, 7 months ago

@Dev Sharma Well, are you going to fix your solution?

Pi Han Goh - 5 years, 7 months ago

Log in to reply

Which part is missing?

Dev Sharma - 5 years, 7 months ago

Log in to reply

The proof that f ( f ( f ( 5 10000 ) ) ) f(f(f(5^{10000}))) has 1 digit only.

Sharky Kesa - 5 years, 7 months ago

Log in to reply

@Sharky Kesa 5 10000 5^{10000} has at most 9999 digits whose sum is at most 89991 \Rightarrow f(f(89991)= 9 \Rightarrow the answer really has one digit

Guillermo Templado - 5 years, 7 months ago

Log in to reply

@Guillermo Templado Yes, thats what I was looking for!

Julian Poon - 5 years, 7 months ago

Log in to reply

@Julian Poon No, I'm not right,for example f(f(59347))= f(28) = 10. I'll think later about this, the solution can be 13 or 22 how you or Sharky told, even 31

Guillermo Templado - 5 years, 7 months ago

Log in to reply

@Guillermo Templado Oh yeah, thats true. Any x that is bigger of equal to 19999999999999999999999, f(f(f(x))) might be equal to 10 or more.

Julian Poon - 5 years, 7 months ago

@Julian Poon A bound is required. That's the only missing part in the solution.

Sharky Kesa - 5 years, 7 months ago

@Sharky Kesa This is what I have shown through cyclicity

Dev Sharma - 5 years, 7 months ago

Log in to reply

@Dev Sharma No you haven't. This proof is only for ( m o d 10 ) \pmod{10} . If it isn't, how do you know that this pattern breaks down for some large integer n n . For instance:

f ( f ( f ( 4 999...999 55555 9 ’s ) ) ) = 13 4 f(f(f(4\underbrace { 999...999 }_{\text{55555 }9 \text{'s}})))=13 \neq 4

Sharky Kesa - 5 years, 7 months ago

@Dev Sharma You have only shown that it repeats mod 10, you have not shown that it would be a single digit. The answer for this question is a single digit only because 5 10000 5^{10000} isn't a big enough number to obtain a bigger number.

Julian Poon - 5 years, 7 months ago

Log in to reply

@Julian Poon I have not shown that it repeats mod 10, i have shown 3 times sum of 5^n

Dev Sharma - 5 years, 7 months ago

Log in to reply

@Dev Sharma Yes, you have shown it repeats in ( m o d 10 ) \pmod{10} . Also, if it is not in ( m o d 10 ) \pmod{10} where is your proof that this cyclicity occurs for all powers of 5 5 (even extremely large powers)? Your solution only shows that the first few powers satisfy.

Sharky Kesa - 5 years, 7 months ago

Log in to reply

@Sharky Kesa Please show your proof

Dev Sharma - 5 years, 7 months ago

Log in to reply

@Dev Sharma We're only saying that your solution is wrong and requires working on.

Sharky Kesa - 5 years, 7 months ago

@Dev Sharma So you're not going to fix it then?

Pi Han Goh - 5 years, 7 months ago

Nice problem 👌

Akhil Krishna - 5 years, 7 months ago

Log in to reply

Thanks Akhil!

Rohit Udaiwal - 5 years, 7 months ago

Like others are saying you must show that the answer is single digit. For that we can calculate the number of digits in the number which is 10000log5=6990 which has a maximum sum of 6990×9=62910. This means that if we take digit sum thrice it has to be a single digit number and then you can use your pattern.

Kushagra Sahni - 5 years, 7 months ago

Log in to reply

Finding the upper bound for f ( 5 10000 ) f(5^{10000}) is not enough, because f ( f ( 62910 ) ) f(f(62910)) is not necessary the biggest it can get. Consider f ( f ( 19999 ) ) f(f(19999)) . It is bigger than f ( f ( 62910 ) ) f(f(62910)) despite 62910 > 19999 62910>19999

Julian Poon - 5 years, 7 months ago

Log in to reply

Yes I realized that after I wrote the comment and it is also pointed out by Guillermo Templado. Maybe you can help to make it a complete solution.

Kushagra Sahni - 5 years, 7 months ago
Sualeh Asif
Nov 15, 2015

See problem 4 of the 1975 IMO .

The solution can be imitated

Potsawee Manakul
Dec 8, 2015

Solving f(5^1000) with C++

Does it also work for n = 32,768 or n = 2,147,483,648 .. ?

Alisa Meier - 5 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...