OFFSET
1,2
COMMENTS
The sequence starts with a central dot and expands outward with (n-1) centered polygonal pyramids producing a truncated octahedron. Each iteration requires the addition of (n-2) edges and (n-1) vertices to complete the centered polygon of each face. [centered squares (A001844) and centered hexagons (A003215)]
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Wikipedia, Tetrahedral number
Wikipedia, Triangular number
Wikipedia, Centered polygonal number
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = 12*n^3 - 18*n^2 + 8*n - 1.
G.f.: x*(1+x)*(x^2 + 34*x + 1) / (x-1)^4. - R. J. Mathar, Aug 26 2011
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4); a(0)=1, a(1)=39, a(2)=185, a(3)=511. - Harvey P. Dale, Aug 27 2011
E.g.f.: 1 - (1 - 2*x - 18*x^2 - 12*x^3)*exp(x). - G. C. Greubel, Nov 10 2018
MATHEMATICA
Table[12n^3-18n^2+8n-1, {n, 40}] (* or *) LinearRecurrence[{4, -6, 4, -1}, {1, 39, 185, 511}, 40] (* Harvey P. Dale, Aug 27 2011 *)
PROG
(Excel) (copy and paste the following formula =12*ROW()^3-18*ROW()^2+8*ROW()-1 fill down to desired size.)
(Magma) [12*n^3-18*n^2+8*n-1: n in [1..50]]; // Vincenzo Librandi, Aug 30 2011
(PARI) vector(40, n, 12*n^3 - 18*n^2 + 8*n - 1) \\ G. C. Greubel, Nov 10 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Craig Ferguson, Jul 18 2011
STATUS
approved