How to find a "better description" (e.g. recurrence relation) for this sequence?

428 Views Asked by At

My solution to a problem in Project Euler required to solve this subproblem: find values of $k\in\mathrm{N}$ such that $3k^2+4$ is a perfect square.

As I was writing a computer program, I just tried all $k$ and checking if $3k^2+4$ is a perfect square. I solved the problem, but this is not efficient and it doesn't really answer the question.

It turns out that this sequence is http://oeis.org/A052530, there is an easy recurrence relation ($k_n = 4k_{n-1} - k_{n-2}$), and some closed-form formulas for $k_n$ (e.g. $k_n = \left((2+\sqrt{3})^n-(2-\sqrt{3})^n\right)/\sqrt{3}$).

Now I know some answers, but I still don't see how to derive them from the definition. Also, I wasn't able to prove that the recurrence relation works (given that $k_{n-2}$ and $k_{n-1}$ are to consecutive terms of the sequence, prove that $4k_{n-1} - k_{n-2}$ is a term in the sequence, and that it is next term).

So my question is: given the definition of the sequence ($k\in\mathrm{N}$ such that $3k^2+4=n^2$), how can I find a recurrence relation for this sequence?

I will be very happy if can use the same procedure for other similar sequences.

1

There are 1 best solutions below

1
On

$3k^2+4=n^2$ ; as $n\to \infty$, $3k^2\cong n^2$ ; so $\sqrt 3\cong n/k, \sqrt 3-(n/k)\cong 0$ ; taking $\sqrt 3=x ;kx-n\cong (+/-)0, (kx-n)^m\to 0$, as $m\to \infty$
$2-x=2-1.732051=0.267949$ $(2-x)^2=(2^2+x^2-2\times 2\times x)=(7-4x)=0.071797$
$(7^2+4^2\times 3-2\times 7\times 4x)=(97-56x)=0.005155$
$(a_1-b_1\times x)\cong 0 $;then $a_1^2+3\times b_1^2-2\times a_1\times b_1\times x = (a_1-b_1\times x)^2 \cong 0 $or$\to a_2-b_2\times x\cong 0$ , where $a_2=a_1^2+3\times b_1^2 ;b_2=2\times a_1\times b_1$, in this case $7^2-4^2\times 3 =1 ;97^2-3\times 56^2 =9409-9408=1$
This process can be repeated.