Is it Number Theory or Combinatorics ?

For k 1 k≥1 , let a k a_{k} be the greatest divisor of k k which is not a multiple of 3 3 .

Set S 0 = 0 S_{0}=0 and S k = a 1 + a 2 + . . . + a k S_{k}=a_{1}+a_{2}+...+a_{k} for k 1 k≥1 .

Find the number of integers k k with 0 k < 3 15 0≤k<3^{15} such that S k S_{k} is divisible by 3 3 .

Note A generalization of this problem was once proposed for IMO .

Try other interesting combinatorics in my set Hard


The answer is 4782969.

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.

3 solutions

Souryajit Roy
Dec 8, 2014

Generalization For k 1 k≥1 , let a k a_{k} be the greatest divisor of k k which is not a multiple of 3 3 .

Set S 0 = 0 S_{0}=0 and S k = a 1 + a 2 + . . . + a k S_{k}=a_{1}+a_{2}+...+a_{k} for k 1 k≥1 .

Let A n A_{n} be the number of integers 0 k < 3 n 0≤k<3^{n} such that S k S_{k} is divisible by 3 3 .

Then A n = 3 n + 2. 3 n / 2 c o s ( n π / 6 ) 3 A_{n}=\frac{3^{n}+2.3^{n/2}cos(nπ/6)}{3} .

Proof : It is easy to see that a 3 k = a k a_{3k}=a_{k} , a 3 k + 1 = 3 k + 1 a_{3k+1}=3k+1 , a 3 k + 2 = 3 k + 2 a_{3k+2}=3k+2

Now, S 0 0 ( m o d 3 ) S_{0}≡0(mod 3) , S 1 1 ( m o d 3 ) S_{1}≡1(mod 3) and S 2 0 ( m o d 3 ) S_{2}≡0(mod 3)

I claim that S 3 k S k ( m o d 3 ) S_{3k}≡S_{k}(mod 3) , S 3 k + 1 S k + 1 ( m o d 3 ) S_{3k+1}≡S_{k}+1(mod 3) and S 3 k + 2 S k ( m o d 3 ) S_{3k+2}≡S_{k}(mod 3) .

I will prove it by induction on k k .Suppose the result is true for k k .

Then, S 3 k + 3 = S 3 k + 2 + a 3 k + 3 S k + a k + 1 = S k + 1 ( m o d 3 ) S_{3k+3}=S_{3k+2}+a_{3k+3}≡S_{k}+a_{k+1}=S_{k+1} (mod 3)

S 3 k + 4 = S 3 k + 3 + a 3 k + 4 S k + 1 + 3 k + 4 S k + 1 + 1 ( m o d 3 ) S_{3k+4}=S_{3k+3}+a_{3k+4}≡S_{k+1}+3k+4≡S_{k+1}+1(mod 3)

Finally, S 3 k + 5 = S 3 k + 4 + a 3 k + 5 S k + 1 + 1 + 5 S k + 1 ( m o d 3 ) S_{3k+5}=S_{3k+4}+a_{3k+5}≡S_{k+1}+1+5≡S_{k+1} (mod 3)

Let T k T_{k} be the number of 1 1 's in the ternary (base 3 3 ) representation of k k .

T 0 = 0 T_{0}=0 , T 1 = 1 T_{1}=1 and T 2 = 0 T_{2}=0

A little thinking shows T 3 k = T k T_{3k}=T_{k} , T 3 k + 1 = T k + 1 T_{3k+1}=T_{k}+1 and T 3 k + 2 = T k T_{3k+2}=T_{k}

Hence, S k T k ( m o d 3 ) S_{k}≡T_{k} (mod 3) .Therefore, A n A_{n} is the number of integers 0 k 3 n 0≤k≤3^{n} that has ternary representation in which the number of 1 1 's is a multiple of 3.

Now,there are 2 n j ( n j ) 2^{n-j}\binom{n}{j} integers less than 3 n 3^{n} which have j j ones in their ternary representation, since there are ( n j ) \binom{n}{j} ways to choose the places for 1 1 and 2 n j 2^{n-j} ways to put 0 0 or 2 2 in the remaining n j n-j places.

Hence, A n = j 0 ( m o d 3 ) ( n j ) 2 n j A_{n}=\sum_{j≡0(mod3)}\binom{n}{j}2^{n-j}

Let f ( x ) = ( x + 2 ) n = j = 0 n ( n j ) x j 2 n j f(x)=(x+2)^{n}=\sum_{j=0}^{n}\binom{n}{j}x^{j}2^{n-j}

Let ω = e 2 π i / 3 ω=e^{2πi/3} be cube root of unity.

By, Multisection Formula

A n = f ( 1 ) + f ( ω ) + f ( ω 2 ) 3 = 3 n + 2. 3 n / 2 c o s ( n π 6 ) 3 A_{n}=\frac{f(1)+f(ω)+f(ω^{2})}{3}=\frac{3^{n}+2.3^{n/2}cos(\frac{n\pi}{6})}{3} (Simplifying)

Putting n = 15 n=15 gives the required answer.

Note The Multisection Formula says-

If f ( x ) = k a k x k f(x)=\sum_{k}a_{k}x^{k} , then k r ( m o d m ) a k x k = 1 m s = 0 m 1 ω r s f ( ω s x ) \sum_{k≡r(mod m)}a_{k}x^{k}=\frac{1}{m}\sum_{s=0}^{m-1}ω^{-rs}f(ω^{s}x) where ω = e 2 π i / m ω=e^{2πi/m} .

Nice problem! Do you know when it was proposed for the IMO? I'd like to find out more about the background of this problem.

Jon Haussmann - 6 years, 5 months ago

Log in to reply

It was proposed for 1992 IMO

Souryajit Roy - 6 years, 5 months ago
Sourav Mishra
Jan 19, 2015

Was all of this really reqd. I managed it by just using the fact that such nos. are only of form 3k-1. And all natural No's. <= 3^15. of such type satisfied it. I.e. No's. Like 2,5,8,...... To 3^15. The no. Of terms of the A. P. gives the final ans. As. G. I. F. OF [3^14+1÷3].

True. I was a bit puzzled too when I saw such a complex solution.

Kunal Verma - 6 years, 2 months ago

Probably fine here, but if this was on the IMO, you'll need a more rigorous proof.

Lee Gao - 6 years, 1 month ago

I think you've got the right answer by accident -- not completely a coincidence, since of course the answer is that roughly 1/3 of the numbers are of the right form. But in fact S1=1, S2=3, S3=4, S4=8, S5=13 (not a multiple of 3, while your pattern says it should be), S6=15 (a multiple of 3, while your pattern says it shouldn't be). The pattern posted in other solutions, involving 1s in the ternary representation, is correct.

ben handley - 6 years, 1 month ago
Lee Gao
Dec 8, 2014

This was a fun puzzle. Warning: I'm in a computer scientist by nature so my solutions usually have a non purely-analytic nature to them. Here's how I solved this puzzle with linear algebra by reducing this to a rewrite system.

The difficult part of the problem depends on finding a nice recurrence to describe the system. Suppose that ( n + 1 2 ) {n+1\choose 2} describes the total of 1 , , n 1,\dots, n , then it is clear that S n = ( n + 1 2 ) 2 ( n 3 + 1 2 ) 2 ( n 3 2 + 1 2 ) S_n = {n+1\choose 2} - 2 {\left\lfloor \frac{n}{3} \right\rfloor + 1 \choose 2} - 2 {\left\lfloor \frac{n}{3^2} \right\rfloor + 1 \choose 2} - \cdots With a bit of manipulation, and appealing to the fact the \cdots in the above sum terminates after a finite ( log 3 ( n ) \left\lfloor \log_3(n) \right\rfloor ) number of times, we shall see that S n = ( n + 1 2 ) + S n / 3 3 ( n 3 + 1 2 ) S_n = {n+1\choose 2} + S_{\lfloor n/3 \rfloor} - 3 {\left\lfloor \frac{n}{3} \right\rfloor + 1 \choose 2}

Theorem: Let T n = S n mod 3 T_n = S_n ~\text{mod}~3 , then T 0 = 0 , T 1 = 1 , T 2 = 0 T_0 = 0, T_1 = 1, T_2 = 0 and T 3 n + m = T n + [ m 1 ] T_{3n+m} = T_{n} + [m \equiv 1] Proof: Follows from the definition of S n S_n . ~~~~~~~~~~\square

Corollary: It is the case that T 3 n = T n T_{3n} = T_n Proof: Also follows from the definition of S n S_n . ~~~~~~~~~~\square

The above two lemmas tells us two things: 1) we can uniquely determine what S 3 n + 1 , S 3 n + 2 S_{3n+1}, S_{3n+2} are from S 3 n S_{3n} . 2) The subsequence ( T 0 , T 3 , T 6 , ) = ( T 0 , T 1 , T 2 , ) (T_0, T_3, T_6, \cdots) = (T_0, T_1, T_2, \cdots) .

Now, in order to solve this problem, let us look at a tower of sequences.

Let T 15 = ( T 0 ) T 14 = ( T 0 , T 3 14 , T 2 × 3 14 ) T 13 = ( T 0 , T 3 13 , , T 8 × 3 14 ) T 1 = ( T 0 , T 3 , , T 3 15 3 ) T 0 = ( T 0 , T 1 , , T 3 15 1 ) \begin{aligned} T^{15} &= (T_0) \\ T^{14} &= (T_0, T_{3^{14}}, T_{2\times 3^{14}}) \\ T^{13} &= (T_0, T_{3^{13}}, \cdots, T_{8\times 3^{14}}) \\ & \vdots \\ T^{1} &= (T_0, T_3, \cdots, T_{3^{15}-3}) \\ T^{0} &= (T_0, T_1, \cdots, T_{3^{15}-1}) \end{aligned}

Based on the theorem we've proved above, we know that if we see a 0 0 in T k + 1 T ^{k+1} , then it would expand into the sequence ( 0 , 1 , 0 ) (0,1,0) in T k T^k . Similarly, 1 ( 1 , 2 , 1 ) 1 \mapsto (1,2,1) and 2 ( 2 , 0 , 2 ) 2 \mapsto (2,0,2) . Now we're onto something.

Let F ( T k + 1 ) = T k F(T^{k+1}) = T^k be the reduction rule. Suppose that we define a surjection γ ( ( 0 , 1 , 2 , 0 , 2 , 0 , 0 , 0 ) ) = ( 5 , 1 , 2 ) \gamma((0,1,2,0,2,0,0,0)) = (5,1,2) that counts the number of occurrences of 0, 1, and 2 respectively, then it turns out that we can transfer our reduction transformation F ( T k + 1 ) F(T^{k+1}) into a linear transformation γ ( F ) = ( 2 0 1 1 2 0 0 1 2 ) \gamma(F) = \left(\begin{array}{ccc}2 & 0 & 1 \\ 1 & 2 &0 \\ 0 & 1 & 2\end{array}\right)

This is because each instance of 0 in T k T^k can be generated twice from a 0 in T k + 1 T_{k+1} and once from a 2, so on for 1 and 2 as well. The crucial feature of the problem that enables us to construct this surjective counting is the fact that the ordering of T n T_n isn't important.

Finally, we wish to find the count of T n T_n that are zero, which is solved by taking ( 1 0 0 ) γ ( T 0 ) = ( 1 0 0 ) γ ( F ) 15 γ ( T 15 ) = ( 1 0 0 ) ( 2 0 1 1 2 0 0 1 2 ) 15 ( 1 0 0 ) (1 ~~ 0 ~~ 0) \gamma(T^{0}) = (1 ~~ 0 ~~ 0) \gamma(F)^{15} \gamma(T^{15}) = (1 ~~ 0 ~~ 0)\left(\begin{array}{ccc}2 & 0 & 1 \\ 1 & 2 &0 \\ 0 & 1 & 2\end{array}\right)^{15} \left(\begin{array}{c}1 \\ 0 \\ 0\end{array}\right)

You can compute this on a CAS if you want, but its characteristic polynomial ρ ( x ) = ( x 3 ) ( x 2 3 x + 3 ) \rho(x) = (x-3) \left(x^2-3 x+3\right) has roots λ = 3 , 3 ± i 3 2 \lambda = 3, \frac{3 \pm i\sqrt{3}}{2} , which means that the count is α 3 n + β ( 3 + i 3 2 ) n + γ ( 3 + i 3 2 ) n = 3 n 1 \alpha 3^n + \beta \left(\frac{3 + i\sqrt{3}}{2}\right)^n + \gamma\left(\frac{3 + i\sqrt{3}}{2}\right)^n = 3^{n-1} So in our case, we just have 3 15 1 = 4782969 3^{15-1} = \boxed{4782969} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...