AMC 10 Step by Step

2022 AMC 10B Problem 25

P21-25~8 minPrint

Let x0,x1,x2,…x_0,x_1,x_2,\dotsc be a sequence of numbers, where each xkx_k is either 00 or 11 . For each positive integer nn , define Sn=∑k=0n−1xk2kS_n = \sum_{k=0}^{n-1} x_k 2^k Suppose 7Sn≡1(mod2n)7S_n \equiv 1 \pmod{2^n} for all n≥1n \geq 1 . What is the value of the sum x2019+2x2020+4x2021+8x2022?x_{2019} + 2x_{2020} + 4x_{2021} + 8x_{2022}?

Log in to save your progress.
Show solution without answering

Key insight

Write the first few S_n in binary. After the first 1 the bits repeat 1, 1, 0, so bits at multiples of 3 are 0.

Solution

SnS_n is the number whose binary digits, from the right, are x0,x1,…,xn−1x_0, x_1, \ldots, x_{n-1}. The condition 7Sn≡1(mod2n)7S_n \equiv 1 \pmod{2^n} means: 7Sn7S_n leaves remainder 11 when divided by 2n2^n. The target x2019+2x2020+4x2021+8x2022x_{2019} + 2x_{2020} + 4x_{2021} + 8x_{2022} just needs the four bits x2019x_{2019} to x2022x_{2022}.

  1. Only one choice at each stage. SnS_n is between 00 and 2n−12^n - 1. If two such numbers AA and BB both worked, 7(A−B)7(A - B) would be a multiple of 2n2^n. Since 77 is odd, A−BA - B itself would be a multiple of 2n2^n, so A=BA = B. Also, the last nn bits of Sn+1S_{n+1} form a number that passes the test for 2n2^n (dropping the top bit subtracts a multiple of 2n2^n, which does not change the remainder), so they form SnS_n. So there is one fixed string of bits, and each SnS_n is its last nn bits.
  2. Small cases. Find each SnS_n by adding the next bit (either 00 or the next power of 22) and testing.
nnSnS_ncheckbinary
11117=2⋅3+17 = 2 \cdot 3 + 111
223321=4⋅5+121 = 4 \cdot 5 + 11111
337749=8⋅6+149 = 8 \cdot 6 + 1111111
447749=16⋅3+149 = 16 \cdot 3 + 101110111
552323161=32⋅5+1161 = 32 \cdot 5 + 11011110111
665555385=64⋅6+1385 = 64 \cdot 6 + 1110111110111
775555385=128⋅3+1385 = 128 \cdot 3 + 101101110110111

Reading from the right: x0=1x_0 = 1, then x1,x2,x3=1,1,0x_1, x_2, x_3 = 1, 1, 0 and x4,x5,x6=1,1,0x_4, x_5, x_6 = 1, 1, 0. So xk=0x_k = 0 exactly when kk is a positive multiple of 33.
3. Why the pattern continues. In binary 7=1117 = 111. Let TT be the binary number 001 001…001001\,001 \ldots 001 with mm blocks. Multiplying by 111111 turns each 001001 into 111111, so 7T=111…1117T = 111\ldots111 (3m3m ones) =23m−1= 2^{3m} - 1.
4. Build the answer from TT. Let N=23m−TN = 2^{3m} - T. Then
7N=7⋅23m−(23m−1)=6⋅23m+1,7N = 7 \cdot 2^{3m} - (2^{3m} - 1) = 6 \cdot 2^{3m} + 1,
which leaves remainder 11 when divided by 23m2^{3m}. So N=S3mN = S_{3m}.
5. NN in binary. N=(23m−1−T)+1N = (2^{3m} - 1 - T) + 1. Subtracting TT from 111…111111\ldots111 just flips each bit of TT, giving 110 110…110110\,110 \ldots 110. Adding 11 gives 110 110…111110\,110 \ldots 111. This is exactly the pattern from step 2, for as many blocks as we like.
6. Read off the bits. 2019=3×6732019 = 3 \times 673 and 2022=3×6742022 = 3 \times 674 are multiples of 33, so x2019=x2022=0x_{2019} = x_{2022} = 0. The positions 20202020 and 20212021 are not, so x2020=x2021=1x_{2020} = x_{2021} = 1.
7. The sum. 0+2×1+4×1+8×0=60 + 2 \times 1 + 4 \times 1 + 8 \times 0 = 6.

The answer is (A) 6\boxed{\textbf{(A)}\ 6}.

Why this works

The bits repeat because 23=82^3 = 8 is one more than 77, just as the decimal digits of 17\frac17 repeat because 106−110^6 - 1 is a multiple of 77. Computing a handful of small cases shows the pattern, and the fact that 7×001001…001=111111…1117 \times 001001\ldots001 = 111111\ldots111 in binary proves it. When a problem asks about a far-away term, look for a repeating cycle first.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

SnS_n is the nn-bit binary number xn−1…x1x0x_{n-1} \dots x_1 x_0, so the condition says SnS_n is the unique inverse of 77 modulo 2n2^n; each SnS_n is determined, and Sn+1S_{n+1} adds one bit on top. The desired sum is the 44-bit block x2022x2021x2020x2019x_{2022}x_{2021}x_{2020}x_{2019}.

Small cases (each checked directly, e.g. 7⋅23=161=5⋅32+17 \cdot 23 = 161 = 5 \cdot 32 + 1): S1=1S_1 = 1, S2=3S_2 = 3, S3=7S_3 = 7, S4=7S_4 = 7, S5=23S_5 = 23, S6=55S_6 = 55, S7=55S_7 = 55. The bits x0,x1,…x_0, x_1, \dots are 1,1,1,0,1,1,0,…1, 1, 1, 0, 1, 1, 0, \dots: after x0=1x_0 = 1 the block 1,1,01, 1, 0 seems to repeat.

Proof of the pattern: since 23≡1(mod7)2^3 \equiv 1 \pmod 7, the number Tm=23m−17T_m = \frac{2^{3m} - 1}{7} is an integer, with binary form 001 001…001001\,001 \dots 001 (mm blocks). Let N=23m−TmN = 2^{3m} - T_m. Then
7N=7⋅23m−(23m−1)=6⋅23m+1≡1(mod23m),7N = 7 \cdot 2^{3m} - (2^{3m} - 1) = 6 \cdot 2^{3m} + 1 \equiv 1 \pmod{2^{3m}},
and 0<N<23m0 < N < 2^{3m}, so S3m=NS_{3m} = N. In binary, 23m−Tm=(23m−1−Tm)+12^{3m} - T_m = (2^{3m} - 1 - T_m) + 1 is the bitwise complement of TmT_m plus one: 110 110…110+1=110 110…111110\,110 \dots 110 + 1 = 110\,110 \dots 111. Reading from the bottom, x0=1x_0 = 1 and for k≥1k \ge 1, xk=0x_k = 0 exactly when 3∣k3 \mid k.

Take m=675m = 675 so 3m=2025>20223m = 2025 > 2022. Then x2019=0x_{2019} = 0 (2019=3⋅6732019 = 3 \cdot 673), x2020=1x_{2020} = 1, x2021=1x_{2021} = 1, x2022=0x_{2022} = 0 (2022=3⋅6742022 = 3 \cdot 674).

The sum is 0+2+4+0=60 + 2 + 4 + 0 = 6.

The answer is (A) 6\boxed{\textbf{(A)}\ 6}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.