%I #86 Aug 14 2022 18:07:00
%S 0,1,4,11,23,42,69,106,154,215,290,381,489,616,763,932,1124,1341,1584,
%T 1855,2155,2486,2849,3246,3678,4147,4654,5201,5789,6420,7095,7816,
%U 8584,9401,10268,11187,12159,13186
%N 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).
%C Alternately add and subtract successively longer sets of integers: 0; 1 = 0+1; -4 = 1-2-3; 11 = -4+4+5+6; -23 = 11-7-8-9-10; 42 = -23+11+12+13+14+15; -69 = 42-16-17-18-19-20-21; ... then take absolute values. - _Walter Carlini_, Aug 28 2003
%C Number of 3 X 3 symmetric matrices with nonnegative integer entries, such that every row (and column) sum equals n-1.
%C Equals Sum_{0..n} of "three-quarter squares" sequence (A077043). - Philipp M. Buluschek (kitschen(AT)romandie.com), Aug 12 2007
%C a(n) is the sum of the n-th row in A220075, n > 0. - _Reinhard Zumkeller_, Dec 03 2012
%C Sum of all the smallest parts in the partitions of 3n into three parts (see example). - _Wesley Ivan Hurt_, Jan 23 2014
%C For n > 0, a(n) is the number of (nonnegative integer) magic labelings of the prism graph Y_3 with magic sum n - 1. - _L. Edson Jeffery_, Sep 09 2017
%C Or number of magic labelings of LOOP X C_3 with magic sum n - 1, where LOOP is the 1-vertex, 1-loop-edge graph, as Y_k = I X C_k and LOOP X C_k have the same numbers of magic labelings when k is odd. - _David J. Seal_, Sep 13 2017
%C a(n) is the number of triples of integers in [1,n]^3 such that each pair has sum larger than n. - _Bob Zwetsloot_, Jul 23 2020
%D R. P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, 1986; see Prop. 4.6.21, p. 235, G_3(lambda).
%D R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.14(a), p. 452.
%H Vincenzo Librandi, <a href="/A019298/b019298.txt">Table of n, a(n) for n = 0..1000</a>
%H G. E. Andrews, P. Paule and A. Riese, <a href="https://www.researchgate.net/publication/277299165_MacMahon's_Partition_Analysis_III_The_Omega_Package">MacMahon's partition analysis III. The Omega package</a>, January 1999, p. 13.
%H L. Carlitz, <a href="http://dx.doi.org/10.1215/S0012-7094-66-03392-8">Enumeration of symmetric arrays</a>, Duke Math. J., Vol. 33 (1966), 771-782. MR0201332 (34 #1216).
%H R. P. Stanley, <a href="https://pdfs.semanticscholar.org/6054/5d22b1c1ec269264a717b18f3e3d8b346f99.pdf">Magic labelings of graphs, symmetric magic squares,...</a>, Duke Math. J. 43 (3) (1976) 511-531, Section 5, F_3(x).
%H R. P. Stanley, <a href="/A002721/a002721.pdf">Examples of Magic Labelings</a>, Unpublished Notes, 1973 [Cached copy, with permission]
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).
%F a(n) = floor((n^2+1)(2n+3)/8).
%F G.f.: x*(x^2+x+1)/((x+1)*(x-1)^4).
%F a(n) = floor((2n^3 + 3n^2 + 2n)/8); also nearest integer to ((n+1)^4 - n^4)/16.
%F a(n) = (4n^3 + 6n^2 + 4n+1 - (-1)^n)/16. - Wesley Petty (Wesley.Petty(AT)mail.tamucc.edu), Mar 06 2004
%F 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
%F E.g.f.: (1/16)*(-exp(-x) + exp(x)*(1 + 14*x + 18*x^2 + 4*x^3)). - _Stefano Spezia_, Nov 29 2019
%F 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
%e Add last column for a(n) (n > 0).
%e 13 + 1 + 1
%e 12 + 2 + 1
%e 11 + 3 + 1
%e 10 + 4 + 1
%e 9 + 5 + 1
%e 8 + 6 + 1
%e 7 + 7 + 1
%e 10 + 1 + 1 11 + 2 + 2
%e 9 + 2 + 1 10 + 3 + 2
%e 8 + 3 + 1 9 + 4 + 2
%e 7 + 4 + 1 8 + 5 + 2
%e 6 + 5 + 1 7 + 6 + 2
%e 7 + 1 + 1 8 + 2 + 2 9 + 3 + 3
%e 6 + 2 + 1 7 + 3 + 2 8 + 4 + 3
%e 5 + 3 + 1 6 + 4 + 2 7 + 5 + 3
%e 4 + 4 + 1 5 + 5 + 2 6 + 6 + 3
%e 4 + 1 + 1 5 + 2 + 2 6 + 3 + 3 7 + 4 + 4
%e 3 + 2 + 1 4 + 3 + 2 5 + 4 + 3 6 + 5 + 4
%e 1 + 1 + 1 2 + 2 + 2 3 + 3 + 3 4 + 4 + 4 5 + 5 + 5
%e 3(1) 3(2) 3(3) 3(4) 3(5) .. 3n
%e ---------------------------------------------------------------------
%e 1 4 11 23 42 .. a(n)
%p series(x*(x^2+x+1)/(x+1)/(x-1)^4,x,80);
%t Table[ Ceiling[3*n^2/4], {n, 0, 37}] // Accumulate (* _Jean-François Alcover_, Dec 20 2012, after Philipp M. Buluschek's comment *)
%t CoefficientList[Series[x (x^2 + x + 1) / ((x + 1) (x - 1)^4), {x, 0, 40}], x] (* _Vincenzo Librandi_, Jul 28 2013 *)
%t LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 4, 11, 23}, 38] (* _L. Edson Jeffery_, Sep 09 2017 *)
%o (PARI) a(n)=(n^2+1)*(2*n+3)\8 \\ _Charles R Greathouse IV_, Apr 04 2013
%o (Magma) [Floor((n^2+1)*(2*n+3)/8): n in [0..80]]; // _Vincenzo Librandi_, Jul 28 2013
%Y Cf. A053493, A077043 (first differences), A002717.
%Y Cf. A061927, A244497, A292281, A244873, A289992 (# of magic labelings of prism graph Y_k = I X C_k, for k = 4,5,6,7,8, up to an offset).
%Y Cf. A006325, A244879, A244880 (# of magic labelings of LOOP X C_k, for k = 4,6,8, up to an offset).
%K nonn,easy,nice
%O 0,3
%A Eric E Blom (eblom(AT)REM.re.uokhsc.edu)
%E Error in n=8 term corrected May 15 1997