# Is there an integral number k satisfying the equation a[n] = k^2?

I have a sequence a[n] with

$$a(n+1)=4 a(n)-2 a(n-1),\quad a(0) = 1,\ a(1) = 28.$$

I use

RSolve[{a[n + 1] == 4 a[n] - 2  a[n - 1], a[0] == 1, a[1] == 28}, a, n]


and got

{{a -> Function[{n}, 1/2 ((2 - Sqrt[2])^n - 13 Sqrt[2] (2 - Sqrt[2])^n + (2 + Sqrt[2])^n + 13 Sqrt[2] (2 + Sqrt[2])^n)]}}


Now I tried to find an integer k such that a[n]==k^2, k from 1 to 100.

Reduce[{1/2 ((2 - Sqrt[2])^n - 13 Sqrt[2] (2 - Sqrt[2])^n + (2 + Sqrt[2])^n + 13 Sqrt[2] (2 + Sqrt[2])^n) == k, 1 <= k <= 100,2 <= n <= 100}, {k, n}, Integers]


False

Is there an integral number k that satisfies the equation a[n] == k^2 ($$n \neq 0$$)?
• a[0]==1==1^2? – Kagaratsch Jun 10 at 14:55
• Did you mean to write == k^2 rather than == k? – JimB Jun 10 at 15:00
• @JimB a[n]=1, 4, 9, .... – minhthien_2016 Jun 10 at 15:06
• Would the following be a more direct brute force approach: nMax = 1000; Select[ Sqrt[Table[ Expand[1/ 2 ((2 - Sqrt[2])^n - 13 Sqrt[2] (2 - Sqrt[2])^n + (2 + Sqrt[2])^n + 13 Sqrt[2] (2 + Sqrt[2])^n)], {n, nMax}]], # \[Element] Integers &]. – JimB Jun 10 at 15:14