OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
J.-P. Ehrmann et al., Problem POLYA002, Integer pairs (x,y) for which (x^2+y^2)/(1+pxy) is an integer.
Index entries for linear recurrences with constant coefficients, signature (7,-7,1).
FORMULA
a(n) = 2*t(m)*a(n-1)-a(n-2)-1, a(0) = m, a(1) = m^3+m^2-1 with m = 2.
G.f.: (3*x-2)/((1-6*x+x^2)*(x-1)).
a(0)=2, a(1)=11, a(2)=63, a(n)=7*a(n-1)-7*a(n-2)+a(n-3). - Harvey P. Dale, Nov 06 2011
a(n) = (4+(14-11*sqrt(2))*(3-2*sqrt(2))^n+(3+2*sqrt(2))^n*(14+11*sqrt(2)))/16. - Colin Barker, Mar 05 2016
MATHEMATICA
CoefficientList[Series[(3x-2)/((1-6x+x^2)(x-1)), {x, 0, 20}], x] (* or *) LinearRecurrence[{7, -7, 1}, {2, 11, 63}, 20] (* Harvey P. Dale, Nov 06 2011 *)
PROG
(Magma) I:=[2, 11, 63]; [n le 3 select I[n] else 7*Self(n-1)-7*Self(n-2)+Self(n-3): n in [1..20]]; // Vincenzo Librandi, Nov 13 2011
(PARI) Vec((3*x-2)/((1-6*x+x^2)*(x-1)) + O(x^40)) \\ Colin Barker, Mar 05 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Floor van Lamoen, Nov 29 2001
STATUS
approved