1. ## Sequences and primes

Consider an integer sequence $\displaystyle {\left\{ {{a_n}} \right\}_{n \in \mathbb{N}}}$ satisfying: $\displaystyle {a_n} = a \cdot {a_{n - 1}} + b \cdot {a_{n - 2}}$ for $\displaystyle n \geqslant 2$ ( $\displaystyle a,b \in \mathbb{Z}$ )

Let $\displaystyle p$ be a prime, $\displaystyle p \leqslant \tfrac{n} {2}$ (when this is possible) . Prove that $\displaystyle {a_n} \equiv a \cdot {a_{n - p}} + b \cdot {a_{n - 2p}}\left( {\bmod .p} \right)$

Have fun!

2. Originally Posted by PaulRS
Consider an integer sequence $\displaystyle {\left\{ {{a_n}} \right\}_{n \in \mathbb{N}}}$ satisfying: $\displaystyle {a_n} = a \cdot {a_{n - 1}} + b \cdot {a_{n - 2}}$ for $\displaystyle n \geqslant 2$ ( $\displaystyle a,b \in \mathbb{Z}$ )

Let $\displaystyle p$ be a prime, $\displaystyle p \leqslant \tfrac{n} {2}$ (when this is possible) . Prove that $\displaystyle {a_n} \equiv a \cdot {a_{n - p}} + b \cdot {a_{n - 2p}}\left( {\bmod .p} \right)$

Have fun!
the main idea is to prove that for any $\displaystyle m \leq n/2$ we have $\displaystyle a_n=\sum_{j=0}^m \binom{m}{j}a^{m-j}b^j a_{n-m-j}.$ the proof is by induction over $\displaystyle m$ and noting that if $\displaystyle m+1 \leq n/2,$ then:

$\displaystyle \sum_{j=0}^{m+1} \binom{m+1}{j}a^{m+1-j}b^ja_{n-m-j-1}=\sum_{j=0}^{m+1} \left[\binom{m}{j-1} + \binom{m}{j} \right]a^{m+1-j}b^ja_{n-m-j-1}$

$\displaystyle =\sum_{j=0}^m \binom{m}{j}a^{m-j}b^{j+1}a_{n-m-j-2} + \sum_{j=0}^m \binom{m}{j}a^{m+1-j}b^j a_{n-m-j-1}$

$\displaystyle =\sum_{j=0}^m \binom{m}{j}a^{m-j}b^j(aa_{n-m-j-1} + ba_{n-m-j-2})=\sum_{j=0}^m \binom{m}{j}a^{m-j}b^ja_{n-m-j}=a_n,$ by induction hypothesis.

if $\displaystyle m=p \leq n/2$ is a prime, then $\displaystyle \binom{p}{j} \equiv 0 \mod p,$ for all $\displaystyle 0 < j < p.$ so the above gives us: $\displaystyle a_n \equiv a^p a_{n-p} + b^p a_{n-2p} \mod p.$ but for any integer $\displaystyle c: \ c^p \equiv c \mod p.$ Q.E.D.