A019298 Number of balls in pyramid with base either a regular hexagon or a hexagon with alternate sides differing by 1 (balls in hexagonal pyramid of height n taken from hexagonal close-packing).
0, 1, 4, 11, 23, 42, 69, 106, 154, 215, 290, 381, 489, 616, 763, 932, 1124, 1341, 1584, 1855, 2155, 2486, 2849, 3246, 3678, 4147, 4654, 5201, 5789, 6420, 7095, 7816, 8584, 9401, 10268, 11187, 12159, 13186
Offset: 0
Examples
Add last column for a(n) (n > 0). 13 + 1 + 1 12 + 2 + 1 11 + 3 + 1 10 + 4 + 1 9 + 5 + 1 8 + 6 + 1 7 + 7 + 1 10 + 1 + 1 11 + 2 + 2 9 + 2 + 1 10 + 3 + 2 8 + 3 + 1 9 + 4 + 2 7 + 4 + 1 8 + 5 + 2 6 + 5 + 1 7 + 6 + 2 7 + 1 + 1 8 + 2 + 2 9 + 3 + 3 6 + 2 + 1 7 + 3 + 2 8 + 4 + 3 5 + 3 + 1 6 + 4 + 2 7 + 5 + 3 4 + 4 + 1 5 + 5 + 2 6 + 6 + 3 4 + 1 + 1 5 + 2 + 2 6 + 3 + 3 7 + 4 + 4 3 + 2 + 1 4 + 3 + 2 5 + 4 + 3 6 + 5 + 4 1 + 1 + 1 2 + 2 + 2 3 + 3 + 3 4 + 4 + 4 5 + 5 + 5 3(1) 3(2) 3(3) 3(4) 3(5) .. 3n --------------------------------------------------------------------- 1 4 11 23 42 .. a(n)
References
- R. P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, 1986; see Prop. 4.6.21, p. 235, G_3(lambda).
- R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.14(a), p. 452.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- G. E. Andrews, P. Paule and A. Riese, MacMahon's partition analysis III. The Omega package, January 1999, p. 13.
- L. Carlitz, Enumeration of symmetric arrays, Duke Math. J., Vol. 33 (1966), 771-782. MR0201332 (34 #1216).
- R. J. Mathar, Illustrations of magic labelings (2025)
- R. P. Stanley, Magic labelings of graphs, symmetric magic squares,..., Duke Math. J. 43 (3) (1976) 511-531, Section 5, F_3(x).
- R. P. Stanley, Examples of Magic Labelings, Unpublished Notes, 1973 [Cached copy, with permission]
- Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
Crossrefs
Programs
-
Magma
[Floor((n^2+1)*(2*n+3)/8): n in [0..80]]; // Vincenzo Librandi, Jul 28 2013
-
Maple
series(x*(x^2+x+1)/(x+1)/(x-1)^4,x,80);
-
Mathematica
Table[ Ceiling[3*n^2/4], {n, 0, 37}] // Accumulate (* Jean-François Alcover, Dec 20 2012, after Philipp M. Buluschek's comment *) CoefficientList[Series[x (x^2 + x + 1) / ((x + 1) (x - 1)^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 28 2013 *) LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 4, 11, 23}, 38] (* L. Edson Jeffery, Sep 09 2017 *)
-
PARI
a(n)=(n^2+1)*(2*n+3)\8 \\ Charles R Greathouse IV, Apr 04 2013
-
Python
def A019298(n): return n*(n*(2*n+3)+2)+3>>3 # Chai Wah Wu, Jun 07 2025
Formula
a(n) = floor((n^2+1)(2n+3)/8).
G.f.: x*(x^2+x+1)/((x+1)*(x-1)^4).
a(n) = floor((2n^3 + 3n^2 + 2n)/8); also nearest integer to ((n+1)^4 - n^4)/16.
a(n) = (4n^3 + 6n^2 + 4n+1 - (-1)^n)/16. - Wesley Petty (Wesley.Petty(AT)mail.tamucc.edu), Mar 06 2004
a(n) = Sum_{i=1..n} i^2 - floor(i^2/4) = Sum_{i=1..n} i * (2n - 2i + 1 - floor((n - i + 1)/2) ). - Wesley Ivan Hurt, Jan 23 2014
E.g.f.: (1/16)*(-exp(-x) + exp(x)*(1 + 14*x + 18*x^2 + 4*x^3)). - Stefano Spezia, Nov 29 2019
a(2*n) = (1/2)*( n*(n + 1)^3 - (n - 1)*n^3 ); a(2*n-1) = (1/2)*( (n + 1)*n^3 - n*(n - 1)^3 ) (note: replacing the exponent 3 with 2 throughout gives the sequence of generalized pentagonal numbers A001318). - Peter Bala, Aug 11 2021
a(2n-1) = A213772(n). - R. J. Mathar, Mar 02 2025
(n-2)*a(n) -3*a(n-1) -(n+1)*a(n-2) +2*n-1 =0. - R. J. Mathar, Mar 09 2025
Extensions
Error in n=8 term corrected May 15 1997
Comments