# Find squares in recurrence relation

Find all squares in $$\{a_n\}$$ which obeys the following recurrence relation:
$$a_0=a_1=1, a_{n+2}=6a_{n+1}-a_n$$

I've tried to solve the equation $$n^2+(n+1)^2=m^4$$ and got this recurrence relation.
(If and only if $$m^2\in\{a_i\}_{i=2,3,\dots}$$, $$m$$ satisfies this equation, I suppose.)
I'd be happy if you could share your ideas on how to find the all square numbers in $$\{a_i\}_{i=2,3,\dots}=\{5,29,169,985,5741,\dots\}$$ with me. There seems to be only one square in the first 30 terms, according to my computer. Interestingly, each term has very few divisors. I've read one of the proofs of square Fibonacci numbers, but failed to apply it to this problem.

EDIT
Here is the page of this sequence.

Solution
Thanks to your help, I found the elementary solution here.

COMMENT:

I worked many years ago on famous Euler equation $$2y^4-1=z^2$$. This is my experience:

Consider following sets their members are correspondingly make Pythagorean triples:

$$a∈\{0, 3, 119, 4059, 137903, . . . \}$$

$$b∈\{1, 4, 120, 4060, 137904, . . . \}$$

$$c∈\{1, 5, 169, 5741, 195025, . . . \}$$

Now take triple (119, 120, 169) we can write:

$$(120+119)^2=120^2+119^2+2\times120\times 119$$

$$(120-119)^2=120^2+119^2-2\times120\times 119$$

Summing these relations we get:

$$239^2+1=2(120^2+119^2=169^2)$$

Or:

$$239^2+1=2\times 13^4$$

Which gives $$z=239$$ and $$y=13$$

In set c which you have found its complete form only $$1$$ and $$169$$ can be perfect square.This was proved by Lungern on 1942.

• Thank you for sharing this important information. I'd like to know just an outline of that proof. Could you tell me something more about the proof or just how to access it, please? Jul 13, 2020 at 8:16
• You are welcome. for detailed information see 'Diophantine equation $x^4-Dy^2=1$-II'by J.H.E.Cohn in CiteSeerX. Jul 13, 2020 at 9:48

You can directly obtain the solution to this, as it's a homogeneous recurrence in constant coefficients

The characteristic polynomial is $$p(x) = x^2-6x+1$$

The roots of the above are $$r_{1,2} = 3 \pm 2\sqrt{2}$$

Hence, we have $$a_n = k_1(3+2\sqrt{2})^n + k_2(3-2\sqrt{2})^n$$

$$a_0 = 1 = k_1 + k_2$$

$$a_1 = 1 = 3(k_1 + k_2) + 2\sqrt2(k_1-k_2)$$

Solving for $$k_1,k_2$$ we have

$$k_1 = \frac{\sqrt{2} - 1}{2\sqrt2}, k_2 = \frac{\sqrt{2}+1}{2\sqrt{2}}$$

Now I don't know for sure how this would help finding perfect squares, but at least you have a way of determining the $$n^{th}$$ term directly

EDIT

Something interesting about $$a_n$$, you can rewrite it as follows

$$a_n = \frac{1}{2\sqrt2}\left((\sqrt{2}+1)^{2n}(\sqrt{2}-1) + (\sqrt{2}+1)(\sqrt{2}-1)^{2n}\right)$$

$$a_n = \frac{1}{2\sqrt2}\left((\sqrt{2}+1)^{2n-1} + (\sqrt{2}-1)^{2n-1}\right)$$

I'd expand the sum in terms of binomial theorem, terms would cancel out, maybe that might help?