Päevaülesanne

Juhuslik

Harjutuskomplekt

Balti Tee 1994 · Ülesanne 10

Arvuteooria

How many positive integers satisfy the following three conditions:

(i) All digits of the number are from the set {1,2,3,4,5}\{1,2,3,4,5\};

(ii) The absolute value of the difference between any two consecutive digits is 1 ;

(iii) The integer has 1994 digits?

Muuda valikut

Kui oled valmis

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

Ülevaade

Teemad

Jaguvus ja tegurdamine

Lahendused

Lahendus

Solution:

Consider all positive integers with 2n2n digits satisfying conditions (i)(i) and (ii)(ii) of the problem. Let the number of such integers beginning with 1,2,3,41,2,3,4 and 55 be an,bn,cn,dna_{n}, b_{n}, c_{n}, d_{n} and ene_{n}, respectively. Then, for n=1n=1 we have a1=1a_{1}=1 (integer 1212), b1=2b_{1}=2 (integers 2121 and 2323), c1=2c_{1}=2 (integers 3232 and 3434), d1=2d_{1}=2 (integers 4343 and 4545) and e1=1e_{1}=1 (integer 5454). Observe that c1=a1+e1c_{1}=a_{1}+e_{1}.

Suppose now that n>1n>1, i.e., the integers have at least four digits. If an integer begins with the digit 11 then the second digit is 22 while the third can be 11 or 33. This gives the relation

an=an−1+cn−1.a_{n}=a_{n-1}+c_{n-1}.

Similarly, if the first digit is 55, then the second is 44 while the third can be 33 or 55. This implies

en=cn−1+en−1.e_{n}=c_{n-1}+e_{n-1}.

If the integer begins with 2323 then the third digit is 22 or 44. If the integer begins with 2121 then the third digit is 22. From this we can conclude that

bn=2bn−1+dn−1.b_{n}=2b_{n-1}+d_{n-1}.

In the same manner we can show that

dn=bn−1+2dn−1.d_{n}=b_{n-1}+2d_{n-1}.

If the integer begins with 3232 then the third digit must be 11 or 33, and if it begins with 3434 the third digit is 33 or 55. Hence

cn=an−1+2cn−1+en−1.c_{n}=a_{n-1}+2c_{n-1}+e_{n-1}.

From (1), (2) and (5) it follows that cn=an+enc_{n}=a_{n}+e_{n}, which is true for all n≥1n \geq 1. On the other hand, adding the relations (1)-(5) results in

an+bn+cn+dn+en=2an−1+3bn−1+4cn−1+3dn−1+2en−1a_{n}+b_{n}+c_{n}+d_{n}+e_{n}=2a_{n-1}+3b_{n-1}+4c_{n-1}+3d_{n-1}+2e_{n-1}

and, since cn−1=an−1+en−1c_{n-1}=a_{n-1}+e_{n-1},

an+bn+cn+dn+en=3(an−1+bn−1+cn−1+dn−1+en−1)a_{n}+b_{n}+c_{n}+d_{n}+e_{n}=3\left(a_{n-1}+b_{n-1}+c_{n-1}+d_{n-1}+e_{n-1}\right)

Thus the number of integers satisfying conditions (i)(i) and (ii)(ii) increases three times when we increase the number of digits by 22. Since the number of such integers with two digits is 88, and 1994=2+2⋅9961994=2+2\cdot 996, the number of integers satisfying all three conditions is 8⋅39968\cdot 3^{996}.

Võistluse kontekst

Balti Tee tulemused 1994

9 võistkonda

Keskmine tulemus
3,8 / 5
4 või 5 punkti
7 / 9
Eesti
5 / 5

Punktijaotus

02
10
20
30
41
56
Kõigi võistkondade punktid
VõistkondPunktid
St. Petersburg5 / 5
Latvia5 / 5
Poland5 / 5
Sweden5 / 5
Denmark5 / 5
Estonia5 / 5
Finland4 / 5
Lithuania0 / 5
Iceland0 / 5