Problem

Source: 2007 Bulgarian Autumn Math Competition, Problem 12.4

Tags: prime numbers, number theory, linear recurrence



Let $p$ and $q$ be prime numbers and $\{a_{n}\}_{n=1}^{\infty}$ be a sequence of integers defined by: \[a_{0}=0, a_{1}=1, a_{n+2}=pa_{n+1}-qa_{n}\quad\forall n\geq 0\]Find $p$ and $q$ if there exists an integer $k$ such that $a_{3k}=-3$.