OFFSET
0,2
LINKS
Jeremy Gardiner, Table of n, a(n) for n = 0..999
Index entries for linear recurrences with constant coefficients, signature (2,-1).
FORMULA
From G. C. Greubel, Apr 19 2018: (Start)
a(n) = 2*a(n-1) - a(n-2).
G.f.: (1+20*x)/(1-x)^2.
E.g.f.: (21*x + 1)*exp(x). (End)
MATHEMATICA
Range[1, 1000, 21]
LinearRecurrence[{2, -1}, {1, 22}, 50] (* G. C. Greubel, Apr 19 2018 *)
PROG
(PARI) for(n=0, 50, print1(21*n + 1, ", ")) \\ G. C. Greubel, Apr 19 2018
(Magma) I:=[1, 22]; [n le 2 select I[n] else 2*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Apr 19 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeremy Gardiner, Aug 04 2012
STATUS
approved