Maths Olympiad Prep

Library / /374 of 377

Combinatorics Difficulty 6.0 National Olympiad Prove it United States

Problem:

Let pp be a prime positive integer. Define a mod-pp recurrence of degree nn to be a sequence {ak}k0\{a_k\}_{k \geq 0} of numbers modulo pp satisfying a relation of the form ai+n=cn1ai+n1++c1ai+1+c0aia_{i+n} = c_{n-1} a_{i+n-1} + \ldots + c_1 a_{i+1} + c_0 a_i for all i0i \geq 0, where c0,c1,,cn1c_0, c_1, \ldots, c_{n-1} are integers and c0≢0(modp)c_0 \not\equiv 0 \pmod{p}. Compute the number of distinct linear recurrences of degree at most nn in terms of pp and nn.

Solution

Solution:

Answer: 1np1p+1+p2(p2n1)(p+1)21 - n \frac{p-1}{p+1} + \frac{p^{2}(p^{2n}-1)}{(p+1)^{2}}

In the solution all polynomials are taken modulo pp. Call a polynomial nice if it is monic with nonzero constant coefficient. We can associate each recurrence relation with a polynomial: associate
cnai+n+cn1ai+n1++c1ai+1+c0ai=0 c_{n} a_{i+n} + c_{n-1} a_{i+n-1} + \ldots + c_{1} a_{i+1} + c_{0} a_{i} = 0
with
cnxn+cn1xn1++c1x+c0. c_{n} x^{n} + c_{n-1} x^{n-1} + \ldots + c_{1} x + c_{0}.
Let DiD_{i} be the set of mod-pp recurrences {ak}k0\{a_{k}\}_{k \geq 0} where ii is the least integer so that {ak}k0\{a_{k}\}_{k \geq 0} has degree ii, and let di=Did_{i} = |D_{i}|.
Let SnS_{n} be the set of pairs ({ak}k0,P)\left(\{a_{k}\}_{k \geq 0}, P\right) where {ak}k0\{a_{k}\}_{k \geq 0} is a mod-pp recurrence, and PP is a nice polynomial associated to a recurrence relation of degree at most nn satisfied by {ak}k0\{a_{k}\}_{k \geq 0}. To find dnd_{n} generally, we count the number of elements in SnS_{n} in two ways.

On the one hand, for each sequence {ak}k0\{a_{k}\}_{k \geq 0} in DiD_{i}, there exist pnip^{n-i} polynomials PP such that ({ak}k0,P)S\left(\{a_{k}\}_{k \geq 0}, P\right) \in S. Indeed, {ak}k0\{a_{k}\}_{k \geq 0} satisfies any recurrence relation associated with a polynomial multiple of PP. When j=ij = i there is just one nice degree jj polynomial that is a multiple of PP, PP itself. For j>ij > i, there are (p1)pji1(p-1) p^{j-i-1} nice polynomials of degree jj that are multiples of PP, namely QPQ P where QQ is a nice polynomial of degree jij-i. (There are pp choices for the coefficients of x,,xji1x, \ldots, x^{j-i-1} and p1p-1 choices for the constant term.) So the number of nice polynomial multiples of degree at most nn is
1+j=i+1n(p1)pji1=1+(p1)(pni1p1)=pni 1 + \sum_{j=i+1}^{n} (p-1) p^{j-i-1} = 1 + (p-1)\left(\frac{p^{n-i}-1}{p-1}\right) = p^{n-i}
Hence
Sn=i=0ndipni |S_{n}| = \sum_{i=0}^{n} d_{i} p^{n-i}

On the other hand, given a monic polynomial PP of degree ii, there are pip^{i} recurrences {ak}k0\{a_{k}\}_{k \geq 0} such that ({ak}k0,P)S\left(\{a_{k}\}_{k \geq 0}, P\right) \in S, since a0,,ai1a_{0}, \ldots, a_{i-1} can be chosen arbitrarily and the rest of the terms are determined. Since there are (p1)pi1(p-1) p^{i-1} nice polynomials of degree i0i \neq 0 (and 1 nice polynomial for i=0i=0), summing over ii gives
Sn=1+i=1n(p1)p2i1 |S_{n}| = 1 + \sum_{i=1}^{n} (p-1) p^{2i-1}

Now clearly d0=1d_{0} = 1. Setting (1) and (2) equal for nn and n+1n+1 give
i=0n+1dipn+1i=1+(p1)i=1n+1p2i1i=0ndipni=1+(p1)i=1np2i1i=0ndipn+1i=p+(p1)i=1np2i \begin{aligned} \sum_{i=0}^{n+1} d_{i} p^{n+1-i} & = 1 + (p-1) \sum_{i=1}^{n+1} p^{2i-1} \\ \sum_{i=0}^{n} d_{i} p^{n-i} & = 1 + (p-1) \sum_{i=1}^{n} p^{2i-1} \\ \Longrightarrow \sum_{i=0}^{n} d_{i} p^{n+1-i} & = p + (p-1) \sum_{i=1}^{n} p^{2i} \end{aligned}
Subtracting (4) from (3) yields:
dn+1=1p+(p1)i=12n+1(1)i+1pi=(p1)i=02n+1(1)i+1pi=(p1)2i=0np2m=(p1)2(p2n+21p21)=(p1)(p2n+21)p+1 \begin{aligned} d_{n+1} & = 1 - p + (p-1) \sum_{i=1}^{2n+1} (-1)^{i+1} p^{i} \\ & = (p-1) \sum_{i=0}^{2n+1} (-1)^{i+1} p^{i} \\ & = (p-1)^{2} \sum_{i=0}^{n} p^{2m} \\ & = (p-1)^{2}\left(\frac{p^{2n+2}-1}{p^{2}-1}\right) \\ & = \frac{(p-1)(p^{2n+2}-1)}{p+1} \end{aligned}
Thus the answer is
i=0ndi=1+p1p+1i=1n(p2i1)=1+p1p+1(n+p2p2n1p21)=1np1p+1+p2(p2n1)(p+1)2 \begin{aligned} \sum_{i=0}^{n} d_{i} & = 1 + \frac{p-1}{p+1} \sum_{i=1}^{n} (p^{2i} - 1) \\ & = 1 + \frac{p-1}{p+1}(-n + p^{2} \cdot \frac{p^{2n}-1}{p^{2}-1}) \\ & = 1 - n \frac{p-1}{p+1} + \frac{p^{2}(p^{2n}-1)}{(p+1)^{2}} \end{aligned}

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

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.