A000330 Square pyramidal numbers: a(n) = 0^2 + 1^2 + 2^2 + ... + n^2 = n*(n+1)*(2*n+1)/6.
0, 1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015, 1240, 1496, 1785, 2109, 2470, 2870, 3311, 3795, 4324, 4900, 5525, 6201, 6930, 7714, 8555, 9455, 10416, 11440, 12529, 13685, 14910, 16206, 17575, 19019, 20540, 22140, 23821, 25585, 27434, 29370
Offset: 0
Examples
G.f. = x + 5*x^2 + 14*x^3 + 30*x^4 + 55*x^5 + 91*x^6 + 140*x^7 + 204*x^8 + ...
References
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 813.
- A. H. Beiler, Recreations in the Theory of Numbers, Dover Publications, NY, 1964, p. 194.
- A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 215,223.
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 122, see #19 (3(1)), I(n); p. 155.
- John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 47-49.
- H. S. M. Coxeter, Polyhedral numbers, pp. 25-35 of R. S. Cohen, J. J. Stachel and M. W. Wartofsky, eds., For Dirk Struik: Scientific, historical and political essays in honor of Dirk J. Struik, Reidel, Dordrecht, 1974.
- S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (p.165).
- J. M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 310, pp. 46-196, Ellipses, Paris, 2004.
- E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 93.
- L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 2.
- M. Gardner, Fractal Music, Hypercards and More, Freeman, NY, 1991, p. 293.
- Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §8.6 Figurate Numbers, p. 293.
- M. Holt, Math puzzles and games, Walker Publishing Company, 1977, p. 2 and p. 89.
- Simon Singh, The Simpsons and Their Mathematical Secrets. London: Bloomsbury Publishing PLC (2013): 188.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 126.
Links
- Felix Fröhlich, Table of n, a(n) for n = 0..10000 (first 1001 terms from T. D. Noe)
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
- L. Ancora, Quadrature of the Parabola with the Square Pyramidal Number, Mondadori Education, Archimede 66, No. 3, 139-144 (2014).
- Jack Anderson, Amy Woodall, and Alexandru Zaharescu, Arithmetic Polygons and Sums of Consecutive Squares, arXiv:2411.08398 [math.NT], 2024.
- Ben Babcock and Adam Van Tuyl, Revisiting the spreading and covering numbers, arXiv preprint arXiv:1109.5847 [math.AC], 2011.
- Joshua L. Bailey, Jr., A table to facilitate the fitting of certain logistic curves, Annals Math. Stat., 2 (1931), 355-359.
- Joshua L. Bailey, A table to facilitate the fitting of certain logistic curves, Annals Math. Stat., 2 (1931), 355-359. [Annotated scanned copy]
- Michael A. Bennett, Lucas' square pyramid problem revisited, Acta Arithmetica 105 (2002), 341-347.
- Bruno Berselli, A description of the recursive method in Comments lines: website Matem@ticamente (in Italian).
- Fritz Beukers and Jaap Top, On oranges and integral points on certain plane cubic curves, Nieuw Arch. Wiskd., IV (1988), Ser. 6, No. 3, 203-210.
- Henry Bottomley, Illustration of initial terms.
- Steve Butler and Pavel Karasik, A note on nested sums, J. Int. Seq. 13 (2010), 10.4.4, p=1 in first displayed equation page 4.
- Bikash Chakraborty, Proof Without Words: Sums of Powers of Natural numbers, arXiv:2012.11539 [math.HO], 2020.
- Robert Dawson, On Some Sequences Related to Sums of Powers, J. Int. Seq., Vol. 21 (2018), Article 18.7.6.
- Alexander Diaz-Lopez, Pamela E. Harris, Erik Insko, and Darleen Perez-Lavin, Peaks Sets of Classical Coxeter Groups, arXiv preprint arXiv:1505.04479 [math.GR], 2015.
- Anji Dong, Katerina Saettone, Kendra Song, and Alexandru Zaharescu, Cannonball Polygons with Multiplicities, arXiv:2507.18057 [math.NT], 2025. See p. 1.
- Michael Dougherty, Christopher French, Benjamin Saderholm, and Wenyang Qian, Hankel Transforms of Linear Combinations of Catalan Numbers, Journal of Integer Sequences, Vol. 14 (2011), Article 11.5.1.
- David Galvin and Courtney Sharpe, Independent set sequence of linear hyperpaths, arXiv:2409.15555 [math.CO], 2024. See p. 7.
- Manfred Goebel, Rewriting Techniques and Degree Bounds for Higher Order Symmetric Polynomials, Applicable Algebra in Engineering, Communication and Computing (AAECC), Volume 9, Issue 6 (1999), 559-573.
- T. Aaron Gulliver, Sequences from hexagonal pyramid of integers, International Mathematical Forum, Vol. 6, 2011, no. 17, p. 821-827.
- Tian-Xiao He, Peter J.-S. Shiue, Zihan Nie, and Minghao Chen, Recursive sequences and Girard-Waring identities with applications in sequence transformation, Electronic Research Archive (2020) Vol. 28, No. 2, 1049-1062.
- Milan Janjic, Two Enumerative Functions.
- Milan Janjić, On Restricted Ternary Words and Insets, arXiv:1905.04465 [math.CO], 2019.
- Milan Janjic and B. Petkovic, A Counting Function, arXiv preprint arXiv:1301.4550 [math.CO], 2013.
- R. Jovanovic, First 2500 Pyramidal numbers.
- Feihu Liu, Guoce Xin, and Chen Zhang, Ehrhart Polynomials of Order Polytopes: Interpreting Combinatorial Sequences on the OEIS, arXiv:2412.18744 [math.CO], 2024. See pp. 9, 13-15, 24.
- R. P. Loh, A. G. Shannon, and A. F. Horadam, Divisibility Criteria and Sequence Generators Associated with Fermat Coefficients, Preprint, 1980.
- Toufik Mansour, Restricted permutations by patterns of type 2-1, arXiv:math/0202219 [math.CO], 2002.
- Mircea Merca, A Special Case of the Generalized Girard-Waring Formula, J. Integer Sequences, Vol. 15 (2012), Article 12.5.7.
- Cleve Moler, LINPACK subroutine sgefa.f, University of New Mexico, Argonne National Lab, 1978.
- Michael Penn, Counting on a chessboard., YouTube video, 2021.
- Claudio de J. Pita Ruiz V., Some Number Arrays Related to Pascal and Lucas Triangles, J. Int. Seq. 16 (2013) #13.5.7.
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992.
- Torsten Sillke, Square Counting.
- Think Twice, Sum of n squares | explained visually |, video (2017).
- Herman Tulleken, Polyominoes 2.2: How they fit together, (2019).
- G. N. Watson, The problem of the square pyramid, Messenger of Mathematics 48 (1918), pp. 1-22.
- Eric Weisstein's World of Mathematics, Faulhaber's Formula.
- Eric Weisstein's World of Mathematics, Square Pyramidal Number.
- Eric Weisstein's World of Mathematics, Square Tiling.
- Eric Weisstein's World of Mathematics, Power Sum.
- Wikipedia, Faulhaber's formula.
- G. Xiao, Sigma Server, Operate on"n^2".
- Index entries for "core" sequences.
- Index to sequences related to pyramidal numbers.
- Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
- Index entries for two-way infinite sequences.
Crossrefs
Cf. A000217, A000292, A000537, A005408, A006003, A006331, A033994, A033999, A046092, A050409, A050446, A050447, A060493, A100157, A132124, A132112, A156921, A157702, A258708, A351105, A351830.
Sums of 2 consecutive terms give A005900.
Column 0 of triangle A094414.
Column 1 of triangle A008955.
Right side of triangle A082652.
Row 2 of array A103438.
Partial sums of A000290.
Cf. |A084930(n, 1)|.
Cf. A253903 (characteristic function).
Cf. A034705 (differences of any two terms).
Programs
-
GAP
List([0..30], n-> n*(n+1)*(2*n+1)/6); # G. C. Greubel, Dec 31 2019
-
Haskell
a000330 n = n * (n + 1) * (2 * n + 1) `div` 6 a000330_list = scanl1 (+) a000290_list -- Reinhard Zumkeller, Nov 11 2012, Feb 03 2012
-
Magma
[n*(n+1)*(2*n+1)/6: n in [0..50]]; // Wesley Ivan Hurt, Jun 28 2014
-
Magma
[0] cat [((2*n+3)*Binomial(n+2,2))/3: n in [0..40]]; // Vincenzo Librandi, Jul 30 2014
-
Maple
A000330 := n -> n*(n+1)*(2*n+1)/6; a := n->(1/6)*n*(n+1)*(2*n+1): seq(a(n),n=0..53); # Emeric Deutsch with(combstruct): ZL:=[st, {st=Prod(left, right), left=Set(U, card=r), right=Set(U, card=r), U=Sequence(Z, card>=1)}, unlabeled]: subs(r=1, stack): seq(count(subs(r=2, ZL), size=m*2), m=1..45) ; # Zerinvary Lajos, Jan 02 2008 nmax := 44; for n from 0 to nmax do fz(n) := product( (1-(2*m-1)*z)^(n+1-m) , m=1..n); c(n) := abs(coeff(fz(n),z,1)); end do: a := n-> c(n): seq(a(n), n=0..nmax); # Johannes W. Meijer, Mar 07 2009
-
Mathematica
Table[Binomial[w+2, 3] + Binomial[w+1, 3], {w, 0, 30}] CoefficientList[Series[x(1+x)/(1-x)^4, {x, 0, 40}], x] (* Vincenzo Librandi, Jul 30 2014 *) Accumulate[Range[0,50]^2] (* Harvey P. Dale, Sep 25 2014 *)
-
Maxima
A000330(n):=binomial(n+2,3)+binomial(n+1,3)$ makelist(A000330(n),n,0,20); /* Martin Ettl, Nov 12 2012 */
-
PARI
{a(n) = n * (n+1) * (2*n+1) / 6};
-
PARI
upto(n) = [x*(x+1)*(2*x+1)/6 | x<-[0..n]] \\ Cino Hilliard, Jun 18 2007, edited by M. F. Hasler, Jan 02 2024
-
Python
a=lambda n: (n*(n+1)*(2*n+1))//6 # Indranil Ghosh, Jan 04 2017
-
Sage
[n*(n+1)*(2*n+1)/6 for n in (0..30)] # G. C. Greubel, Dec 31 2019
Formula
G.f.: x*(1+x)/(1-x)^4. - Simon Plouffe (in his 1992 dissertation: generating function for sequence starting at a(1))
E.g.f.: (x + 3*x^2/2 + x^3/3)*exp(x).
a(n) = n*(n+1)*(2*n+1)/6 = binomial(n+2, 3) + binomial(n+1, 3).
2*a(n) = A006331(n). - N. J. A. Sloane, Dec 11 1999
Can be extended to Z with a(n) = -a(-1-n) for all n in Z.
a(n) = A002492(n)/4. - Paul Barry, Jul 19 2003
a(n) = (((n+1)^4 - n^4) - ((n+1)^2 - n^2))/12. - Xavier Acloque, Oct 16 2003
From Alexander Adamchuk, Oct 26 2004: (Start)
a(n) = sqrt(A271535(n)).
a(n) = (Sum_{k=1..n} Sum_{j=1..n} Sum_{i=1..n} (i*j*k)^2)^(1/3). (End)
a(n) = Sum_{i=1..n} i*(2*n-2*i+1); sum of squares gives 1 + (1+3) + (1+3+5) + ... - Jon Perry, Dec 08 2004
Sum_{n>=1} 1/a(n) = 6*(3-4*log(2)); Sum_{n>=1} (-1)^(n+1)*1/a(n) = 6*(Pi-3). - Philippe Deléham, May 31 2005
Sum of two consecutive tetrahedral (or pyramidal) numbers a(n) = A000292(n-1) + A000292(n). - Alexander Adamchuk, May 17 2006
Euler transform of length-2 sequence [ 5, -1 ]. - Michael Somos, Sep 04 2006
a(n) = a(n-1) + n^2. - Rolf Pleisch, Jul 22 2007
a(n) = A132121(n,0). - Reinhard Zumkeller, Aug 12 2007
a(n) = binomial(n, 2) + 2*binomial(n, 3). - Borislav St. Borisov (b.st.borisov(AT)abv.bg), Mar 05 2009, corrected by M. F. Hasler, Jan 02 2024
a(n) = A168559(n) + 1 for n > 0. - Reinhard Zumkeller, Feb 03 2012
a(n) = Sum_{i=1..n} J_2(i)*floor(n/i), where J_2 is A007434. - Enrique Pérez Herrero, Feb 26 2012
a(n) = s(n+1, n)^2 - 2*s(n+1, n-1), where s(n, k) are Stirling numbers of the first kind, A048994. - Mircea Merca, Apr 03 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) + 2. - Ant King, Oct 17 2012
a(n) = Sum_{i = 1..n} Sum_{j = 1..n} min(i,j). - Enrique Pérez Herrero, Jan 15 2013
a(n) = Sum_{i=0..n-1} (n-i)*(2*i+1), with a(0) = 0. After 0, row sums of the triangle in A101447. - Bruno Berselli, Feb 10 2014
a(n) = n + 1 + Sum_{i=1..n+1} (i^2 - 2i). - Wesley Ivan Hurt, Feb 25 2014
a(n) = Sum_{i = 1..n} Sum_{j = i..n} max(i,j). - Enrique Pérez Herrero, Dec 03 2014
a(n) = A055112(n)/6, see Singh (2013). - Alonso del Arte, Feb 20 2015
For n > 0: a(n) = A258708(n+3,n-1). - Reinhard Zumkeller, Jun 23 2015
Dirichlet g.f.: zeta(s-3)/3 + zeta(s-2)/2 + zeta(s-1)/6. - Ilya Gutkovskiy, Jun 26 2016
a(n) = A080851(2,n-1). - R. J. Mathar, Jul 28 2016
a(n) = binomial(n-1, 1) + binomial(n-1, 2) + binomial(n, 3) + binomial(n+1, 2) + binomial(n+1, 3). - Tony Foster III, Aug 24 2018
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Nathan Fox, Dec 04 2019
Let T(n) = A000217(n), the n-th triangular number. Then a(n) = (T(n)+1)^2 + (T(n)+2)^2 + ... + (T(n)+n)^2 - (n+2)*T(n)^2. - Charlie Marion, Dec 31 2019
a(n) = 2*n - 1 - a(n-2) + 2*a(n-1). - Boštjan Gec, Nov 09 2023
a(n) = 2/(2*n)! * Sum_{j = 1..n} (-1)^(n+j) * j^(2*n+2) * binomial(2*n, n-j). Cf. A060493. - Peter Bala, Mar 31 2025
Extensions
Partially edited by Joerg Arndt, Mar 11 2010
Comments