Three years, back and forth

If f ( x ) = x ( x + 1 ) ( x + 2 ) ( x + 3 ) ( x + 4 ) ( x + 5 ) ( x + 6 ) \large f(x)=x^{(x+1)^{(x+2)^{(x+3)^{(x+4)^{(x+5)^{(x+6)}}}}}} and g ( x ) = x ( x 1 ) ( x 2 ) ( x 3 ) ( x 4 ) ( x 5 ) ( x 6 ) \large g(x)=x^{(x-1)^{(x-2)^{(x-3)^{(x-4)^{(x-5)^{(x-6)}}}}}}

Then find the last 4 digits of f ( 2015 ) + g ( 2021 ) f(2015)+g(2021)

Harder version

This problem belongs to the set Number theory best problems .


The answer is 626.

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.

1 solution

Matt Janko
Dec 25, 2020

Consider f ( 2015 ) f(2015) , which we will write as 201 5 201 6 a 2015^{2016^a} . To find the last four digits of this value, we need to find residues x x and y y such that x 201 5 201 6 a ( m o d 16 ) and y 201 5 201 6 a ( m o d 625 ) . x \equiv 2015^{2016^a} \pmod {16} \qquad \text{and} \qquad y \equiv 2015^{2016^a} \pmod {625}. By the Chinese remainder theorem, these two residues will tell us the value of 201 5 201 6 a 2015^{2016^a} modulo 16 625 = 10000 16 \cdot 625 = 10000 . Both residues are easy to find. Notice that 201 5 2 1 ( m o d 16 ) 2015^2 \equiv 1 \pmod {16} . Since 201 6 a 2016^a is clearly even, we have 201 5 201 6 a 201 5 2 k ( 201 5 2 ) k 1 k 1 ( m o d 16 ) . 2015^{2016^a} \equiv 2015^{2k} \equiv (2015^2)^k \equiv 1^k \equiv 1 \pmod{16}. Also, notice that 5 5 is a factor of 2015 2015 . Since 201 6 a 2016^a is very large, 5 4 = 625 5^4 = 625 is a factor of 201 5 201 6 a 2015^{2016^a} and thus 201 5 201 6 a 0 ( m o d 625 ) . 2015^{2016^a} \equiv 0 \pmod{625}. By the Chinese remainder theorem, the previous two congruences imply 201 5 201 6 a 625 ( m o d 10000 ) , 2015^{2016^a} \equiv 625 \pmod {10000}, so the last four digits of 201 5 201 6 a 2015^{2016^a} are 0625 0625 .

Now consider g ( 2021 ) g(2021) , which we will write as 202 1 202 0 b 2021^{2020^b} . Notice that 2021 and 10000 are relatively prime and ϕ ( 10000 ) = 4000 \phi(10000) = 4000 . If 202 0 b r ( m o d 4000 ) 2020^b \equiv r \pmod{4000} , then Euler's theorem implies 202 1 202 0 b 202 1 r ( m o d 10000 ) . 2021^{2020^b} \equiv 2021^r \pmod{10000}. The prime factorization of 4000 is 2 5 5 3 2^5 \cdot 5^3 , and 2 2 and 5 5 are both factors of 2020. Since b b is very large, 2 5 2^5 and 5 3 5^3 are both factors of 202 0 b 2020^b and thus 202 0 b 0 ( m o d 4000 ) . 2020^b \equiv 0 \pmod{4000}. By Euler, 202 1 202 0 b 202 1 0 1 ( m o d 10000 ) , 2021^{2020^b} \equiv 2021^0 \equiv 1 \pmod{10000}, so the last four digits of 202 1 202 0 b 2021^{2020^b } are 0001 0001 .

Therefore, the desired value is 625 + 1 = 626 625 + 1 = \boxed{626} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...