cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A006331 a(n) = n*(n+1)*(2*n+1)/3.

This page as a plain text file.
%I A006331 M1963 #210 Jul 02 2025 22:15:40
%S A006331 0,2,10,28,60,110,182,280,408,570,770,1012,1300,1638,2030,2480,2992,
%T A006331 3570,4218,4940,5740,6622,7590,8648,9800,11050,12402,13860,15428,
%U A006331 17110,18910,20832,22880,25058,27370,29820,32412,35150,38038,41080,44280
%N A006331 a(n) = n*(n+1)*(2*n+1)/3.
%C A006331 Triangles in rhombic matchstick arrangement of side n.
%C A006331 Maximum accumulated number of electrons at energy level n. - _Scott A. Brown_, Feb 28 2000
%C A006331 Let M_n denote the n X n matrix M_n(i,j)=i^2+j^2; then the characteristic polynomial of M_n is x^n - a(n)x^(n-1) - .... - _Michael Somos_, Nov 14 2002
%C A006331 Convolution of odds (A005408) and evens (A005843). - _Graeme McRae_, Jun 06 2006
%C A006331 a(n) is the number of non-monotonic functions with domain {0,1,2} and codomain {0,1,...,n}. - _Dennis P. Walsh_, Apr 25 2011
%C A006331 For any odd number 2n+1, find Sum_{a<b, a+b=2n+1} a*b. This sum is equal to the n-th nonzero term of this sequence. Thus for 13=2*n+1, n=6; there are six products, 1*12 + 2*11 + 3*10 + 4*9 + 5*8 + 6*7 = 182, which is also twice the sum of the squares for n=6. - _J. M. Bergot_, Jul 16 2011
%C A006331 a(n) gives the number of (n+1) X (n+1) symmetric (0,1)-matrices containing three ones (see [Cameron]). - _L. Edson Jeffery_, Feb 18 2012
%C A006331 a(n) is the number of 4-tuples (w,x,y,z) with all terms in {0,...,n} and |w - x| < y. - _Clark Kimberling_, Jun 02 2012
%C A006331 Partial sums of A001105. - _Omar E. Pol_, Jan 12 2013
%C A006331 Total number of square diagonals (of any size) in an n X n square grid. - _Wesley Ivan Hurt_, Mar 24 2015
%C A006331 Number of diagonal attacks of two queens on (n+1) X (n+1) chessboard. - _Antal Pinter_, Sep 20 2015
%C A006331 a(n) is the minimum value obtainable by partitioning either the set {x in the natural numbers | 1 <= x <= 2n} or the set {x in the natural numbers | 0 <= x <= 2n+1} into pairs, taking the product of all such pairs, and taking the sum of all such products. - _Thomas Anton_, Oct 21 2020
%C A006331 a(n) is the irregularity of the n-th power of a path of length at least 3*n.  (The irregularity of a graph is the sum of the differences between the degrees over all edges of the graph.) - _Allan Bickle_, Jun 16 2023
%C A006331 a(n) is the maximum possible total number of inversions in all rows and all columns of a Latin square of order n+1. - _Ivaylo Kortezov_, Jun 28 2025
%D A006331 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A006331 Vincenzo Librandi, <a href="/A006331/b006331.txt">Table of n, a(n) for n = 0..10000</a>
%H A006331 J. L. Bailey, Jr., <a href="http://dx.doi.org/10.1214/aoms/1177732978">A table to facilitate the fitting of certain logistic curves</a>, Annals Math. Stat., Vol. 2 (1931), pp. 355-359.
%H A006331 J. L. Bailey, <a href="/A002309/a002309.pdf">A table to facilitate the fitting of certain logistic curves</a>, Annals Math. Stat., Vol. 2 (1931), pp. 355-359. [Annotated scanned copy]
%H A006331 Rowan Beckworth, <a href="https://web.archive.org/web/20060302022601/http://users.senet.com.au/~rowanb/chem/atstruct.html">Basic atomic information</a>.
%H A006331 Allan Bickle and Zhongyuan Che, <a href="https://doi.org/10.1016/j.dam.2023.01.020">Irregularities of Maximal k-degenerate Graphs</a>, Discrete Applied Math. 331 (2023) 70-87.
%H A006331 Allan Bickle, <a href="https://doi.org/10.20429/tag.2024.000105">A Survey of Maximal k-degenerate Graphs and k-Trees</a>, Theory and Applications of Graphs 0 1 (2024) Article 5.
%H A006331 P. Cameron, T. Prellberg and D. Stark, <a href="https://doi.org/10.37236/1111">Asymptotics for incidence matrix classes</a>, Electron. J. Combin. 13 (2006), #R85, p. 11.
%H A006331 Jose Manuel Garcia Calcines, Luis Javier Hernandez Paricio, and Maria Teresa Rivas Rodriguez, <a href="https://arxiv.org/abs/2307.13749">Semi-simplicial combinatorics of cyclinders and subdivisions</a>, arXiv:2307.13749 [math.CO], 2023. See p. 25.
%H A006331 N. S. S. Gu, H. Prodinger and S. Wagner, <a href="https://doi.org/10.1016/j.ejc.2009.10.007">Bijections for a class of labeled plane trees</a>, Eur. J. Combinat., Vol. 31 (2010), pp. 720-732, doi|10.1016/j.ejc.2009.10.007, Theorem 2 at n=3.
%H A006331 JBMO 2025, 29th Junior Balkan Mathematical Olympiad, <a href="https://jbmo.ucoz.org/news/jb25p4s/2025-06-26-116">Problem 4, author: Boris Mihov</a>
%H A006331 Germain Kreweras, <a href="http://www.numdam.org/numdam-bin/item?id=BURO_1965__6__9_0">Sur une classe de problèmes de dénombrement liés au treillis des partitions des entiers</a>, Cahiers du Bureau Universitaire de Recherche Opérationnelle, Institut de Statistique, Université de Paris, Vol. 6 (1965), circa p. 82.
%H A006331 Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H A006331 Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992
%H A006331 Dennis Walsh, <a href="http://frank.mtsu.edu/~dwalsh/MONOFUNC.pdf">Notes on finite monotonic and non-monotonic functions</a>.
%H A006331 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F A006331 G.f.: 2*x*(1 + x)/(1 - x)^4. - _Simon Plouffe_ (in his 1992 dissertation)
%F A006331 a(n) = 2*binomial(n+1,3) + 2*binomial(n+2,3).
%F A006331 a(n) = 2*A000330(n) = A002492(n)/2.
%F A006331 a(n) = Sum_{i=0..n} T(i,n-i), array T as in A048147. - _N. J. A. Sloane_, Dec 11 1999
%F A006331 From the formula for the sum of squares of positive integers 1^2 + 2^2 + 3^2 + ... + n^2 = n*(n+1)(2*n+1)/6, if we multiply both sides by 2 we get Sum_{k=0..n} 2*k^2 = n*(n+1)*(2*n+1)/3, which is an alternative formula for this sequence. - _Mike Warburton_, Sep 08 2007
%F A006331 10*a(n) = A016755(n) - A001845(n); since A016755 are odd cubes and A001845 centered octahedral numbers, 10*a(n) are the "odd cubes without their octahedral contents." - _Damien Pras_, Mar 19 2011
%F A006331 a(n) = sum(a*b), where the summing is over all unordered partitions 2*n+1=a+b. - _Vladimir Shevelev_, May 11 2012
%F A006331 a(n) = binomial(2*n+2, 3)/2. - _Ronan Flatley_, Dec 13 2012
%F A006331 a(n) = A000292(n) + A002411(n). - _Omar E. Pol_, Jan 11 2013
%F A006331 a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n>3, with a(0)=0, a(1)=2, a(2)=10, a(3)=28. - _Harvey P. Dale_, Apr 12 2013
%F A006331 a(n) = A208532(n+1,2). - _Philippe Deléham_, Dec 05 2013
%F A006331 Sum_{n>0} 1/a(n) = 9 - 12*log(2). - _Enrique Pérez Herrero_, Dec 03 2014
%F A006331 a(n) = A000292(n-1) + (n+1)*A000217(n). - _J. M. Bergot_, Sep 02 2015
%F A006331 a(n) = 2*(A000332(n+3) - A000332(n+1)). - _Antal Pinter_, Sep 20 2015
%F A006331 From _Bruno Berselli_, May 17 2018: (Start)
%F A006331 a(n) = n*A002378(n) - Sum_{k=0..n-1} A002378(k) for n>0, a(0)=0. Also:
%F A006331 A163102(n) = n*a(n) - Sum_{k=0..n-1} a(k) for n>0, A163102(0)=0. (End)
%F A006331 a(n) = A005900(n) - A000290(n) = A096000(n) - A000578(n+1) = A000578(n+1) - A084980(n+1) = A000578(n+1) - A077415(n)-1 = A112524(n) + 1 = A188475(n) - 1 = A061317(n) - A100178(n) = A035597(n+1) - A006331(n+1). - _Bruce J. Nicholson_, Jun 24 2018
%F A006331 E.g.f.: (1/3)*exp(x)*x*(6 + 9*x + 2*x^2). - _Stefano Spezia_, Jan 05 2020
%F A006331 Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi - 9. - _Amiram Eldar_, Jan 04 2022
%e A006331 For n=2, a(2)=10 since there are 10 non-monotonic functions f from {0,1,2} to {0,1,2}, namely, functions f = <f(1),f(2),f(3)> given by <0,1,0>, <0,2,0>, <0,2,1>, <1,0,1>, <1,0,2>, <1,2,0>, <1,2,1>, <2,0,1>, <2,0,2>, and <2,1,2>. - _Dennis P. Walsh_, Apr 25 2011
%e A006331 Let n=4, 2*n+1 = 9. Since 9 = 1+8 = 3+6 = 5+4 = 7+2, a(4) = 1*8 + 3*6 + 5*4 + 7*2 = 60. - _Vladimir Shevelev_, May 11 2012
%p A006331 A006331 := proc(n)
%p A006331     n*(n+1)*(2*n+1)/3 ;
%p A006331 end proc:
%p A006331 seq(A006331(n),n=0..80) ; # _R. J. Mathar_, Sep 27 2013
%t A006331 Table[n(n+1)(2n+1)/3,{n,0,40}] (* or *) LinearRecurrence[{4,-6,4,-1},{0,2,10,28},50] (* _Harvey P. Dale_, Apr 12 2013 *)
%o A006331 (PARI) a(n)=if(n<0,0,n*(n+1)*(2*n+1)/3)
%o A006331 (Magma) [n*(n+1)*(2*n+1)/3: n in [0..40]]; // _Vincenzo Librandi_, Aug 15 2011
%o A006331 (Haskell)
%o A006331 a006331 n = sum $ zipWith (*) [2*n-1, 2*n-3 .. 1] [2, 4 ..]
%o A006331 -- _Reinhard Zumkeller_, Feb 11 2012
%Y A006331 A row of A132339.
%Y A006331 Cf. A002378, A048147, A098077, A163102.
%Y A006331 Cf. A005900, A084980, A077415, A112524, A188475, A100178, A035597, A096000.
%Y A006331 Cf. A002378, A046092, A028896 (irregularities of maximal k-degenerate graphs).
%K A006331 nonn,easy,nice
%O A006331 0,2
%A A006331 _N. J. A. Sloane_