Seeking series formula for: $3, 2, 4, 7, 11, 16, 26, 39, 63, 94, 152, 227, 367, 548, 886, 1323, 2139, 3194$

There is a recursive formula given by $a_{n+4} = 2 a_{n+2} + a_{n}$ . This suggests separating the formula into even and odd components. I'll work on getting an explicit formula.

Edit: the formula I obtained is:

$$a_{2n} = \frac{1}{4}((6 - \sqrt{2} )(1+\sqrt{2})^n + (6 + \sqrt{2} )(1-\sqrt{2})^n)$$

$$a_{2n+1} = \frac{1}{4}((6 - \sqrt{2} )(1-\sqrt{2})^n + (6 + \sqrt{2} )(1+\sqrt{2})^n)$$


Once we find the fundamental solutions $m=7,n=2$, giving the $45,28,53$ triangle and $m=4,n=3$ giving the $7,24,25$ triangle we can note that you want $(m^2-n^2)-2mn=\pm 17$, which we can rewrite as $(m-n)^2-2n^2=\pm 17$ We can then use the Brahmagupta identity to take one $m,n$ pair and say the next pair is $(2m+n,m)$. This recurrence gives the even terms and odd terms in your sequence separately.


You misunderstood the output of Wolfram. Perhaps the words "generating function" were in there somwhere? What it means is $$ {\frac {-3\,{x}^{3}+2\,{x}^{2}-2\,x-3}{{x}^{4}+2\,{x}^{2}-1}} =3+2\,x+ 4\,{x}^{2}+7\,{x}^{3}+11\,{x}^{4}+16\,{x}^{5}+26\,{x}^{6}+39\,{x}^{7}+ 63\,{x}^{8}+94\,{x}^{9}+152\,{x}^{10}+227\,{x}^{11}+367\,{x}^{12}+548 \,{x}^{13}+886\,{x}^{14}+1323\,{x}^{15}+2139\,{x}^{16}+3194\,{x}^{17}+ 5164\,{x}^{18}+7711\,{x}^{19}+\dots $$ when you expand as a power series. This is the same as the recursion in user's answer.