Maths Olympiad Prep

Library / /293 of 297

, 2026

Number theory Difficulty 4.8 AIME Find the answer Canada

The string of digits 123451234551234555123451234551234555\ldots is formed by
alternately writing the digits 12341234, in that order, and then writing
some number of consecutive 55s.
There are exactly kk consecutive
55s immediately following the kkth occurrence of 12341234. If SS is the sum of the first 20262026 digits of the string, what is the
sum of the digits of SS?

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solutions — 2

Solution 1

Suppose the number of complete strings of 12341234 is kk. We can compute the number of digits up
to and including the rightmost 44 in
the string. It is 4k4k (kk occurrences of each of 11, 22, 33, and 44) plus the number of 55s, which is 4k+(1+2+3+4++(k2)+(k1))4k + \bigg(1+2+3+4+\cdots+(k-2)+(k-1)\bigg) Note that the kk 5s that follow the final 12341234 are not included in this count. This
sum is equal to 4k+(k1)k2=8k+k2k2=k2+7k24k+\dfrac{(k-1)k}{2}=\dfrac{8k+k^2-k}{2} = \dfrac{k^2+7k}{2} so there are k2+7k2\dfrac{k^2+7k}{2} digits up to and
including the rightmost 44.

The total number of digits is 20262026,
so kk must be the greatest integer
satisfying $k2+7k2\$\dfrac{k^2+7k}{2} \leq
2026,whichisequivalentto, which is equivalent to k2+7kk^2+7k\leq 4052$.

Notice that 602+7(60)=402060^2+7(60)=4020 but
612+7(61)=414861^2+7(61)=4148, so we have that
k=60k=60, meaning that there are 6060 complete strings of 12341234.

Thus, the number of digits up to and including the rightmost 44 is $602+7(60)2=40202=2010\$\dfrac{60^2+7(60)}{2} = \dfrac{4020}{2}=2010.Therewouldbe. There would be 605safterthe 5s after the 60thth 4,whichismorethanthe, which is more than the 2026-2010=16digitsneededtoreach digits needed to reach 2026$ digits in total. This means there
are no "partial" strings of 12341234.

Therefore, among the first 20262026
digits, there are 6060 each of 11, 22, 33, 44
for a total of 4×60=2404\times 60=240
digits, and the rest must be 55.
Thus, 2026240=17862026-240=1786 of the digits
are 55.

The sum of the first 20262026 digits
is S=1×60+2×60+3×60+4×60+5×1786=9530S=1\times 60 + 2\times 60 + 3\times 60 + 4\times 60 + 5\times 1786 = 9530 The sum of the digits of SS is 9+5+3+0=179+5+3+0=17.

Solution 2

Suppose the number of complete strings of 12341234 is cc. We can compute the number of digits up
to and including the rightmost 44 in
the string. It is 4c4c (cc occurrences of each of 11, 22, 33, and 44) plus the number of 55s, which is 4c+(1+2+3+4++(c2)+(c1))4c + \bigg(1+2+3+4+\cdots+(c-2)+(c-1)\bigg) Note that the cc 5s that follow the final 12341234 are not included in this count. This
sum is equal to 4c+(c1)c2=8c+c2c2=c2+7c24c+\dfrac{(c-1)c}{2}=\dfrac{8c+c^2-c}{2} = \dfrac{c^2+7c}{2} so there are c2+7c2\dfrac{c^2+7c}{2} digits up to and
including the rightmost 44.

The total number of digits is 20262026,
so cc must be the greatest integer
satisfying $c2+7c2\$\dfrac{c^2+7c}{2} \leq
2026,whichisequivalentto, which is equivalent to c2+7cc^2+7c\leq 4052$.

Notice that 602+7(60)=402060^2+7(60)=4020 but
612+7(61)=414861^2+7(61)=4148, so we have that
c=60c=60.

Thus, the number of digits up to and including the rightmost 44 is $602+7(60)2=40202=2010\$\dfrac{60^2+7(60)}{2} = \dfrac{4020}{2}=2010.Therewouldbe. There would be 605safterthe 5s after the 60thth 4,whichismorethanthe, which is more than the 2026-2010=16digitsneededtoreach digits needed to reach 2026$ digits in total. This means there
are no "partial" strings of 12341234.

Therefore, among the first 20262026
digits, there are 6060 each of 11, 22, 33, 44
for a total of 4×60=2404\times 60=240
digits, and the rest must be 55.
Thus, 2026240=17862026-240=1786 of the digits
are 55.

The sum of the first 20262026 digits
is S=1×60+2×60+3×60+4×60+5×1786=9530S=1\times 60 + 2\times 60 + 3\times 60 + 4\times 60 + 5\times 1786 = 9530 The sum of the digits of SS is 9+5+3+0=179+5+3+0=17.

Want a route through all this instead of an archive? The track puts 2,444 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: CEMC, University of Waterloo, licensed CC-BY-NC-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.