OFFSET
1,2
COMMENTS
Equivalently, numbers k such that sqrt((k+1)*(2*k+1)/6) is an integer.
REFERENCES
Edward J. Barbeau, Pell's Equation, New York: Springer-Verlag, 2003, p. 19, Exercise 2.8.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..437
Peter Khoury and Gerard D. Koffi, Continued fractions and their application to solving Pell’s equations (2009).
Tanya Khovanova, Recursive Sequences.
Index entries for linear recurrences with constant coefficients, signature (195,-195,1).
FORMULA
a(n) = ((7/2 + 2*sqrt(3))*(97 + 56*sqrt(3))^n + (7/2 - 2*sqrt(3))*(97 - 56*sqrt(3))^n - 3)/4.
a(n) = (floor((7/2 + 2*sqrt(3))*(97 + 56*sqrt(3))^n) - 2)/4.
a(n+3) = 195*(a(n+2) - a(n+1)) + a(n).
G.f.: x*(1+142*x+x^2)/((1-x)*(1-194*x+x^2)).
a(n) = ((7 - 4*sqrt(3))^(1+2n) + (7 + 4*sqrt(3))^(1+2n) - 6)/8. - Peter Pein (peter.pein(AT)dordos.de), Mar 03 2005
a(n) = 195*a(n-1) - 195*a(n-2) + a(n-3), with a(0)=0, a(1)=1, a(2)=337, a(3)=65521. - Harvey P. Dale, Jul 14 2011
E.g.f.: (exp(x)*(exp(96*x)*(7*cosh(56*sqrt(3)*x) - 4*sqrt(3)*sinh(56*sqrt(3)*x)) - 3) - 4)/4. - Stefano Spezia, Nov 30 2025
EXAMPLE
337 is in the sequence because sqrt((1/337)*Sum_{k=1..337} k^2) is an integer (195=A084232(1)).
MATHEMATICA
a[n_]:=Expand[((7-4 Sqrt[3])^(1+2n)+(7+4 Sqrt[3])^(1+2n)-6)/8] (* Peter Pein *)
CoefficientList[Series[x (1+142x+x^2)/((1-x)(1-194x+x^2)), {x, 0, 30}], x] (* or *) Join[{0}, LinearRecurrence[{195, -195, 1}, {1, 337, 65521}, 30]] (* Harvey P. Dale, Jul 14 2011 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ignacio Larrosa Cañestro, May 20 2003
EXTENSIONS
One more term from Peter Pein (peter.pein(AT)dordos.de), Mar 03 2005
STATUS
approved
