Problem

Source:

Tags: number theory



It is given the sequence defined by $$\{a_{n+2}=6a_{n+1}-a_n\}_{n \in \mathbb{Z}_{>0}},a_1=1, a_2=7 \text{.}$$Find all $n$ such that there exists an integer $m$ for which $a_n=2m^2-1$.