Päevaülesanne

Juhuslik

Harjutuskomplekt

Balti Tee 2017 · Ülesanne 19

Arvuteooria

For an integer n≥1n \geq 1 let a(n)a(n) denote the total number of carries which arise when adding 2017 and n⋅2017n \cdot 2017. The first few values are given by a(1)=1,a(2)=1,a(3)=0a(1)=1, a(2)=1, a(3)=0, which can be seen from the following:

001 001 000
2017 4034 6051
+2017 +2017 +2017
=4034=4034 =6051=6051 =8068=8068

Prove that

a(1)+a(2)+…+a(102017−2)+a(102017−1)=10⋅102017−19a(1)+a(2)+\ldots+a\left(10^{2017}-2\right)+a\left(10^{2017}-1\right)=10 \cdot \frac{10^{2017}-1}{9}
Muuda valikut

Kui oled valmis

Ülevaatematerjal muutub kättesaadavaks järgmise päevaülesannete komplektiga.

Ülevaade

Teemad

Jaguvus ja tegurdamine

Lahendused

Lahendus 1

Let k(m)k(m) be the residue of mm when divided by 10k10^{k}. There is a carry at the digit representing 10k10^{k} exactly when k(2017)+k(n⋅2017)>10kk(2017)+k(n \cdot 2017)>10^{k}. Thus the number of 10-, 100-, 1000- and 10000-carries are, respectively,

⌊7⋅10201710⌋,⌊17⋅102017100⌋,⌊17⋅1020171000⌋,⌊2017⋅10201710000⌋\left\lfloor\frac{7 \cdot 10^{2017}}{10}\right\rfloor,\left\lfloor\frac{17 \cdot 10^{2017}}{100}\right\rfloor,\left\lfloor\frac{17 \cdot 10^{2017}}{1000}\right\rfloor,\left\lfloor\frac{2017 \cdot 10^{2017}}{10000}\right\rfloor

and similarly for the rest of the carries. Thus

∑n=1102017−1a(n)=7⋅102016+17⋅102015+…+2017+201+20+2=(2+0+1+7)⋅102016+(2+0+1+7)⋅102015+…+(2+0+1+7)=10⋅102017−19\begin{aligned} \sum_{n=1}^{10^{2017}-1} a(n) & =7 \cdot 10^{2016}+17 \cdot 10^{2015}+\ldots+2017+201+20+2 \\ & =(2+0+1+7) \cdot 10^{2016}+(2+0+1+7) \cdot 10^{2015}+\ldots+(2+0+1+7)=10 \cdot \frac{10^{2017}-1}{9} \end{aligned}
Lahendus 2

Let s(n)s(n) denote the digit sum of nn. Then we claim the following.

Lemma. We have

s(n+m)=s(n)+s(m)−9a(n,m)s(n+m)=s(n)+s(m)-9 a(n, m)

where a(n,m)a(n, m) denotes the total number of carries, which arises when adding nn and mm.

Proof: We proceed by induction on the maximal number of digits kk of nn and mm.

If both nn and mm are single digit numbers then we have just two cases. If n+m<10n+m<10, then we have no carries and clearly s(n+m)=n+m=s(n)+s(m)s(n+m)=n+m=s(n)+s(m). If on the other hand n+m=10+k≥10n+m=10+k \geq 10, then

s(n+m)=1+k=1+(n+m−10)=s(n)+s(m)−9s(n+m)=1+k=1+(n+m-10)=s(n)+s(m)-9

Assume that the claim holds for all pair with at most kk digits each. Let n=n1+a⋅10k+1n=n_{1}+a \cdot 10^{k+1} and m=m1+b⋅10k+1m=m_{1}+b \cdot 10^{k+1} where n1n_{1} og m1m_{1} are at most kk digit numbers. If there is no carry at the k+1k+1 th digit, then a(n,m)=a(n1,m1)a(n, m)=a\left(n_{1}, m_{1}\right) and thus

s(n+m)=s(n1+m1)+a+b=s(n1)+a+s(m1)+b−9a(n1,m1)=s(n)+s(m)−9a(n,m)\begin{gathered} s(n+m)=s\left(n_{1}+m_{1}\right)+a+b \\ =s\left(n_{1}\right)+a+s\left(m_{1}\right)+b-9 a\left(n_{1}, m_{1}\right)=s(n)+s(m)-9 a(n, m) \end{gathered}

If there is a carry then a(n,m)=1+a(n1,m1)a(n, m)=1+a\left(n_{1}, m_{1}\right) and thus

s(n+m)=s(n1+m1)+a+b−9s(n+m)=s\left(n_{1}+m_{1}\right)+a+b-9 =s(n1)+a+s(m1)+b−9(a(n1,m1)+1)=s(n)+s(m)−9a(n,m)=s\left(n_{1}\right)+a+s\left(m_{1}\right)+b-9\left(a\left(n_{1}, m_{1}\right)+1\right)=s(n)+s(m)-9 a(n, m)

This finishes the induction and we are done.

Now observe that s(2017⋅102017)=2+1+7=10s\left(2017 \cdot 10^{2017}\right)=2+1+7=10. We now use (1) a total of 102017−110^{2017}-1 times which yields

10=s(2017⋅102017)=s(2017⋅(102017−1)+2017)=s(2017⋅(102017−1))+s(2017)−9⋅a(102017−1)⋮=s(2017)+s(2017)⋅(102017−1)−9⋅∑n=1102017−1a(n)=10⋅102017−9⋅∑n=1102017−1a(n)\begin{aligned} 10 & =s\left(2017 \cdot 10^{2017}\right)=s\left(2017 \cdot\left(10^{2017}-1\right)+2017\right) \\ & =s\left(2017 \cdot\left(10^{2017}-1\right)\right)+s(2017)-9 \cdot a\left(10^{2017}-1\right) \\ & \vdots \\ & =s(2017)+s(2017) \cdot\left(10^{2017}-1\right)-9 \cdot \sum_{n=1}^{10^{2017}-1} a(n) \\ & =10 \cdot 10^{2017}-9 \cdot \sum_{n=1}^{10^{2017}-1} a(n) \end{aligned}

Thus we arrive at

∑n=1102017−1a(n)=10⋅102017−19\sum_{n=1}^{10^{2017}-1} a(n)=10 \cdot \frac{10^{2017}-1}{9}

Võistluse kontekst

Balti Tee tulemused 2017

11 võistkonda

Keskmine tulemus
2,2 / 5
4 või 5 punkti
4 / 11
Eesti
0 / 5

Punktijaotus

05
10
20
32
42
52
Kõigi võistkondade punktid
VõistkondPunktid
St. Petersburg5 / 5
Germany5 / 5
Poland3 / 5
Denmark4 / 5
Estonia0 / 5
Lithuania4 / 5
Sweden3 / 5
Norway0 / 5
Finland0 / 5
Iceland0 / 5
Latvia0 / 5