OFFSET
1,1
COMMENTS
The identity (841*n-1)^2-(841*n^2-2*n)*(29)^2 = 1 can be written as A158402(n)^2-a(n)*(29)^2 = 1.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
E. J. Barbeau, Polynomial Excursions, Chapter 10: Diophantine equations (2010), pages 84-85 (row 15 in the first table at p. 85, case d(t) = t*(29^2*t-2)).
Vincenzo Librandi, X^2-AY^2=1
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3.
G.f.: x*(-839-843*x)/(x-1)^3.
MAPLE
MATHEMATICA
LinearRecurrence[{3, -3, 1}, {839, 3360, 7563}, 50]
Table[841n^2-2n, {n, 40}] (* Harvey P. Dale, Jan 31 2023 *)
PROG
(Magma) I:=[839, 3360, 7563]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..50]];
(PARI) a(n) = 841*n^2 - 2*n.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Mar 18 2009
STATUS
approved