OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
T. P. Martin, Shells of atoms, Phys. Rep., 273 (1996), 199-241, eq. (10).
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
From Harvey P. Dale, Jan 01 2012: (Start)
G.f.: x*(x^3 + 1)/(x-1)^4.
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4); a(1)=1, a(2)=4, a(3)=10, a(4)=21. (End)
E.g.f.: (-6 + 12*x + 3*x^2 + 2*x^3)*exp(x)/6 + 1. - G. C. Greubel, Dec 01 2017
MATHEMATICA
Table[(2n-1)(n^2-n+6)/6, {n, 50}] (* or *) LinearRecurrence[{4, -6, 4, -1}, {1, 4, 10, 21}, 50] (* Harvey P. Dale, Jan 01 2012 *)
PROG
(PARI) a(n)=(2*n-1)*(n^2-n+6)/6 \\ Charles R Greathouse IV, Sep 24 2015
(Magma) [(2*n-1)*(n^2-n+6)/6: n in [1..30]]; // G. C. Greubel, Dec 01 2017
(PARI) x='x+O('x^30); Vec(serlaplace((-6 + 12*x + 3*x^2 + 2*x^3)*exp(x)/6 + 1)) \\ G. C. Greubel, Dec 01 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Aug 01 2001
STATUS
approved