2 To The 2 To The 2 To The 2 To The Ad Infinitum

2 , 2 2 , 2 2 2 , 2 2 2 2 , \large 2,2^2,2^{2^2},2^{2^{2^2}},\ldots The sequence above can be recursively defined by a 1 = 2 , a k + 1 = 2 a k a_1=2, a_{k+1}=2^{a_{k}}

Given a positive integer n n , a new sequence is created by dividing each term { a k } \{a_k\} by n n and writing down the remainder of the division. We denote this new sequence by { b k } \{b_{k}\} .

For a given n n , it is known that the terms of { b k } \{b_{k}\} eventually become constant. Let f ( n ) f(n) denote the index at which the constant values begin, i.e. f ( n ) f(n) is the smallest number i i for which b i 1 b i = b i + 1 = b i + 2 = b_{i-1} \neq b_i = b_{i+1} = b_{i+2} = \cdots .

Find f ( 2016 ) + f ( 2015 ) f(2016)+f(2015) .


Proving that the terms of { b n } \{b_{n}\} become constant is an old USAMO problem, which inspired this problem.


The answer is 8.

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.

2 solutions

Xuming Liang
Feb 14, 2016

Relevant wiki: Euler's Theorem

We will use the following observations to compute f ( n ) f(n) :

  • Prime factorize n = p 1 e 1 p 2 e 2 . . . p k e k n=p_{1}^{e_1}p_{2}^{e_2}...p_{k}^{e_k} , then f ( n ) = max { f ( p 1 e 1 ) , f ( p 2 e 2 ) , . . . , f ( p k e k ) } f(n)=\text {max}\{f(p_{1}^{e_1}),f(p_{2}^{e_2}),...,f(p_{k}^{e_k})\}
  • For prime odd p p and positive integer e e , we have f ( p e ) = f ( ord p e ( 2 ) ) + 1 f(p^e)=f(\text {ord}_{p^e}(2))+1

The first point is motivated by the chinese remainder theorem . Since a b ( m o d n ) a b ( m o d p i e i ) a\equiv b\pmod {n} \implies a\equiv b\pmod {p_{i}^{e_i}} because p i e i n p_{i}^{e_i}|n , it is necessary for the { b } \{b\} sequence of p i e i {p_{i}^{e_i}} to start repeating the same value before the { b } \{b\} sequence of n n . By this reasoning, we have f ( n ) f ( p i e i ) f(n)\ge f(p_{i}^{e_i}) for all i = 1 , 2 , . . . , k i=1,2,...,k .

For the second point, we make use of a property of order : 2 a 2 b ( m o d p e ) a b ( m o d ord p e ( 2 ) ) 2^a\equiv 2^b\pmod {p^e}\iff a\equiv b\pmod {\text {ord}_{p^e}(2)} . For our problem specifically, we have a i a i + 1 ( m o d p e ) a i 1 a i ( m o d ord p e ( 2 ) ) a_i\equiv a_{i+1} \pmod {p^e} \iff a_{i-1}\equiv a_{i} \pmod {\text {ord}_{p^e}(2)} In other words, the terms of { b } \{b\} wrt p e p^e repeats one index after those of { b } \{b\} wrt ord p e ( 2 ) \text {ord}_{p^e}(2) , hence the recursive formula is justified.

As a example, we can compute f ( 2016 ) f(2016) as follows:

  • f ( 2 5 ) = 4 f(2^5)=4

  • f ( 3 2 ) = f ( 6 ) + 1 = f ( 3 ) + 1 = f ( 2 ) + 2 = 3 f(3^2)=f(6)+1=f(3)+1=f(2)+2=3

  • f ( 7 ) = f ( 3 ) + 1 = 3 f(7)=f(3)+1=3

Thus f ( 2016 ) = max { f ( 2 5 ) , f ( 3 2 ) , f ( 7 ) } = 4 f(2016)=\text {max}\{f(2^5),f(3^2),f(7)\}=4

In a similar fashion, we can find f ( 2015 ) = 4 f(2015)=4 . Hence the answer is 4 + 4 = 8 4+4=\boxed {8} .

Once we understand what the problem asks (which I didn't), it's not that hard.

We can use the Carmichael Lambda and Euler's Theorem; note that λ ( 2015 ) = 60 , λ ( 60 ) = 4 , λ ( 2016 ) = 24 \lambda(2015)=60, \lambda(60)=4, \lambda(2016)=24 and λ ( 24 ) = 2 \lambda(24)=2 .

Now we have, for any positive integer n n ,

2 2 n 2 2 ( m o d 4 ) 2^{2^n}\equiv 2^2 \pmod{4} so 2 2 2 n 2 2 2 ( m o d 60 ) 2^{2^{2^n}}\equiv 2^{2^2} \pmod{60} and 2 2 2 2 n 2 2 2 2 ( m o d 2015 ) 2^{2^{2^{2^n}}}\equiv 2^{2^{2^2}}\pmod{2015}

Likewise,

2 2 n 2 2 ( m o d 2 ) 2^{2^n}\equiv 2^2 \pmod{2} so 2 2 2 n 2 2 2 ( m o d 24 ) 2^{2^{2^n}}\equiv 2^{2^2} \pmod{24} and 2 2 2 2 n 2 2 2 2 ( m o d 2016 ) 2^{2^{2^{2^n}}}\equiv 2^{2^{2^2}}\pmod{2016}

We can quickly verify that 2 2 2 = 16 2^{2^2}=16 isn't congruent to 2 2 2 2 = 65536 2^{2^{2^2}}=65536 modulo 2015 or 2016.

Thus f ( 2015 ) = f ( 2016 ) = 4 f(2015)=f(2016)=4 and the answer is 8.

Otto Bretscher - 5 years, 4 months ago

Log in to reply

How would you have phrase this question then?

Pi Han Goh - 5 years, 4 months ago

Log in to reply

n n is used with different meanings: a n a_n and b n b_n vs modulo n n ... using different letters would help.

Otto Bretscher - 5 years, 4 months ago

Log in to reply

@Otto Bretscher @Xuming Liang , what do you think?

Pi Han Goh - 5 years, 4 months ago

Log in to reply

@Pi Han Goh Thanks. I've edited the indices in the problem.

I agree that we should avoid having notation do double duty. You don't want to sit through a lecture where all the variables are "a", just of different size.

Calvin Lin Staff - 5 years, 3 months ago

Log in to reply

@Calvin Lin @Calvin Lin

Shouldn't b i + 1 b i = b i + 1 = b i + 2 = b_{i+1} \neq b_i = b_{i+1} = b_{i+2} = \cdots be

b i 1 b i = b i + 1 = b i + 2 = b_{i-1} \neq b_i = b_{i+1} = b_{i+2} = \cdots ?

ZK LIn - 5 years, 3 months ago

Log in to reply

@Zk Lin Thanks, edited the typo.

Calvin Lin Staff - 5 years, 3 months ago

@Calvin Lin BTW, @Calvin Lin , does my (rather short) solution make sense?

Otto Bretscher - 5 years, 3 months ago

Log in to reply

@Otto Bretscher Yes it does. Though, rather than Carmichael Lambda, we actually want something like the "order" of 2 power. You have only shown that 4 is the upper bound, and we still have to check that it is the minimum.

For example, if 2 was replaced by 1, then the answer is clearly f ( 2015 ) = f ( 2016 ) = 1 f(2015) = f(2016) = 1 .

Calvin Lin Staff - 5 years, 3 months ago

Log in to reply

@Calvin Lin Thanks for your comments, @Calvin Lin

Yes, of course, we need to verify that 2 2 2 = 16 2^{2^2}=16 isn't congruent to 2 2 2 2 = 65536 2^{2^{2^2}}=65536 modulo 2015 or 2016; I will add this remark to my solution.

I agree that "in general" we want to think about the order of 2, but in this rather simple case we can get away with the Carmichael Lambda, which makes the solution much shorter and simpler.

Otto Bretscher - 5 years, 3 months ago

Log in to reply

@Otto Bretscher Agreed. I'm playing devil's advocate to the strength / completeness / rigour of a solution.

Calvin Lin Staff - 5 years, 3 months ago
Zk Lin
Feb 17, 2016

To find f ( 2016 ) f(2016) , write:

a n + 1 a n = 2016 k a_{n+1}-a_{n}=2016k .

2 a n 2 a n 1 = 2016 k 2^{a_{n}}-2^{a_{n-1}}=2016k

2 a n 1 ( 2 a n a n 1 1 ) = 63. 2 5 . k 2^{a_{n-1}}(2^{a_{n}-a_{n-1}}-1)=63.2^{5}.k

Note that we must have

2 a n a n 1 1 ( m o d 63 ) 2^{a_{n}-a_{n-1}} \equiv 1 \pmod{63}

By Euler's theorem, since gcd ( 2 , 63 ) = 1 \gcd(2,63)=1

a n a n 1 0 ( m o d ϕ ( 63 ) ) a_{n}-a_{n-1} \equiv 0 \pmod{\phi(63)} is a sufficient but unnecessary condition for the congruence above to hold.

Compute ϕ ( 63 ) = ϕ ( 7 ) ϕ ( 3 2 ) = 6 ( 3 2 3 ) = 36 \phi(63)=\phi(7)\phi(3^{2})=6(3^{2}-3)=36

Note that a 4 a 3 = 2 2 2 2 2 2 2 = 2 2 2 ( 2 2 2 2 2 2 1 ) = 16 ( 2 12 1 ) a_{4}-a_{3}=2^{2^{2^{2}}}-2^{2^{2}}=2^{2^{2}}(2^{2^{2^{2}}-2^{2}}-1)=16(2^{12}-1)

Since 2 3 1 ( m o d 9 ) 2^{3} \equiv -1 \pmod{9} , we have 2 12 ( 2 3 ) 4 1 ( m o d 9 ) 2^{12} \equiv {(2^{3})}^{4} \equiv 1 \pmod{9} .

Therefore, a 4 a 3 = 16 ( 2 12 1 ) = 16 ( 9 q ) = 36 ( 4 q ) a_{4}-a_{3}=16(2^{12}-1)=16(9q)=36(4q) .

We check that a 5 a 4 = 2 a 3 ( 2 a 4 a 3 1 ) = 2 16 ( 63 p ) = 2 11 ( 2016 p ) a_{5}-a_{4}=2^{a_{3}}(2^{a_{4}-a{3}}-1)=2^{16}(63p)=2^{11}(2016p) , which follows from Euler's theorem.

It is fairly easy to show that a 4 a 3 a_{4}-a_{3} is not divisible by 2016 2016 . Note that

a 4 a 3 = 2 a 2 ( 2 a 3 a 2 1 ) = 16 m a_{4}-a_{3}\ = 2^{a_{2}}(2^{a_{3}-a_{2}}-1)= 16m , where m m is an odd number. However, 2016 = 32.63 2016=32.63 , so obviously, a 4 a 3 ( m o d 2016 ) a_{4} \neq a_{3} \pmod{2016} . We conclude that f ( 2016 ) = 4 f(2016)=4 .

To find f ( 2015 ) f(2015) , write

a n + 1 a n = 2015 k a_{n+1}-a_{n}=2015k .

2 a n 2 a n 1 = 2015 k 2^{a_{n}}-2^{a_{n-1}}=2015k

2 a n 1 ( 2 a n a n 1 1 ) = 2015 k 2^{a_{n-1}}(2^{a_{n}-a_{n-1}}-1)=2015k

Note that we must have

2 a n a n 1 1 ( m o d 2015 ) 2^{a_{n}-a_{n-1}} \equiv 1 \pmod{2015}

By Euler's theorem, since gcd ( 2 , 2015 ) = 1 \gcd(2,2015)=1

a n a n 1 0 ( m o d ϕ ( 2015 ) ) a_{n}-a_{n-1} \equiv 0 \pmod{\phi(2015)} is a sufficient but unnecessary condition for the congruence above to hold.

Compute ϕ ( 2015 ) = ϕ ( 5 ) ϕ ( 13 ) ϕ ( 31 ) = 4.12.30 = 1440 \phi(2015)=\phi(5)\phi(13)\phi(31)=4.12.30=1440

Therefore, we obtain a n a n 1 0 ( m o d 1440 ) a_{n}-a_{n-1} \equiv 0 \pmod{1440}

2 a n 2 ( 2 a n 1 a n 2 1 ) = 1440 k = 32.45 k 2^{a_{n-2}}(2^{a_{n-1}-a_{n-2}}-1)=1440k=32.45k

For the congruence to hold, note that ( 2 a n 1 a n 2 1 ) 0 ( m o d 45 ) (2^{a_{n-1}-a_{n-2}}-1)\equiv 0 \pmod{45} .

By Euler's theorem, since gcd ( 2 , 45 ) = 1 \gcd(2,45)=1

a n 1 a n 2 0 ( m o d ϕ ( 45 ) ) a_{n-1}-a_{n-2} \equiv 0 \pmod{\phi(45)} is a sufficient but unnecessary condition for the congruence above to hold.

Compute ϕ ( 45 ) = ϕ ( 5 ) ϕ ( 3 2 ) = 4. ( 3 2 3 ) = 24 \phi(45)=\phi(5)\phi(3^{2})=4.(3^{2}-3)=24

Note that a 4 a 3 = 2 2 2 2 2 2 2 = 2 2 2 ( 2 2 2 2 2 2 1 ) = 16 ( 2 12 1 ) = 16 ( 4095 ) = 24 ( 2730 ) a_{4}-a_{3}=2^{2^{2^{2}}}-2^{2^{2}}=2^{2^{2}}(2^{2^{2^{2}}-2^{2}}-1)=16(2^{12}-1)=16(4095)=24(2730) .

We check that

2 a 3 ( 2 a 4 a 3 1 ) = 2 16 ( 45 k ) = 1440 ( 2048 k ) 2^{a_{3}}(2^{a_{4}-a_{3}}-1)=2^{16}(45k)=1440(2048k)

Therefore, a 5 a 4 = 2 a 3 ( 2 a 4 a 3 1 ) = 2 16 ( 2015 r ) a_{5}-a_{4}=2^{a_{3}}(2^{a_{4}-a_{3}}-1)=2^{16}(2015r) follows from Euler's theorem.

It is fairly easy to show that a 4 a 3 a_{4}-a_{3} is not divisible by 2015 2015 . Note that

a 4 a 3 = 2 a 2 ( 2 a 3 a 2 1 ) = 16 ( 2 12 1 ) = 16 ( 2.2015 + 65 ) = 32.2015 + 1040 a_{4}-a_{3}\ = 2^{a_{2}}(2^{a_{3}-a_{2}}-1)= 16(2^{12}-1)=16(2.2015+65)=32.2015+1040 .

Therefore, we conclude that f ( 2015 ) = 4 f(2015)=4 .

f ( 2015 ) + f ( 2016 ) = 4 + 4 = 8 f(2015)+f(2016)=4+4=\boxed{8} and we are done.

Moderator note:

Great! Very detailed explanation.

Note that instead of "unnecessary condition", what you mean is that it is "not a necessary condition". I've not seen the latter expressed in the former way, though I can infer what you mean.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...