1. ## Sequences and primes

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

Let $p$ be a prime, $p \leqslant \tfrac{n}
{2}$
(when this is possible) . Prove that ${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 ${\left\{ {{a_n}} \right\}_{n \in \mathbb{N}}}
$
satisfying: ${a_n} = a \cdot {a_{n - 1}} + b \cdot {a_{n - 2}}$ for $n \geqslant 2$ ( $a,b \in \mathbb{Z}$ )

Let $p$ be a prime, $p \leqslant \tfrac{n}
{2}$
(when this is possible) . Prove that ${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 $m \leq n/2$ we have $a_n=\sum_{j=0}^m \binom{m}{j}a^{m-j}b^j a_{n-m-j}.$ the proof is by induction over $m$ and noting that if $m+1 \leq n/2,$ then:

$\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}$

$=\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}$

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