OFFSET
1,1
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Vincenzo Librandi, X^2-AY^2=1
Index entries for linear recurrences with constant coefficients, signature (2,-1).
FORMULA
From Harvey P. Dale, Nov 03 2011: (Start)
G.f.: 27*x*(508*x+221)/(x-1)^2.
a(n) = 2*a(n-1) - a(n-2); a(1)=5967, a(2)=25650. (End)
E.g.f.: 27*(508 - (508 - 729*x)*exp(x)). - G. C. Greubel, Nov 17 2018
EXAMPLE
a(1) = 19683*1 - 13716 = 5967;
a(2) = 19683*2 - 13716 = 25650.
MATHEMATICA
19683Range[40]-13716 (* or *) LinearRecurrence[{2, -1}, {5967, 25650}, 40] (* Harvey P. Dale, Nov 03 2011 *)
PROG
(Magma) I:=[5967, 25650]; [n le 2 select I[n] else 2*Self(n-1)-Self(n-2): n in [1..40]];
(PARI) a(n) = 19683*n - 13716.
(Sage) [19683*n-13716 for n in (1..40)] # G. C. Greubel, Nov 17 2018
(GAP) List([1..40], n -> 19683*n-13716); # G. C. Greubel, Nov 17 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Mar 04 2009
EXTENSIONS
Example edited by Jon E. Schoenfield, Nov 17 2018
STATUS
approved