login
A000982
a(n) = ceiling(n^2/2).
(Formerly M1348 N0517)
111
0, 1, 2, 5, 8, 13, 18, 25, 32, 41, 50, 61, 72, 85, 98, 113, 128, 145, 162, 181, 200, 221, 242, 265, 288, 313, 338, 365, 392, 421, 450, 481, 512, 545, 578, 613, 648, 685, 722, 761, 800, 841, 882, 925, 968, 1013, 1058, 1105, 1152, 1201, 1250, 1301, 1352, 1405
OFFSET
0,3
COMMENTS
a(n) = number of pairs (i,j) in [1..n] X [1..n] with integral arithmetic mean. Cf. A132188, A362931. - N. J. A. Sloane, Aug 28 2023
Also, floor( (n^2+1)/2 ). - N. J. A. Sloane, Feb 08 2019
Floor(arithmetic mean of next n numbers). - Amarnath Murthy, Mar 11 2003
Pairwise sums of repeated squares (A008794).
Also, number of topologies on n+1 unlabeled elements with exactly 4 elements in the topology. a(3) gives 4 elements a,b,c,d; the valid topologies are (0,a,ab,abcd), (0,a,abc,abcd), (0,ab,abc,abcd), (0,a,bcd,abcd) and (0,ab,cd,abcd), with a count of 5. - Jon Perry, Mar 05 2004
Partition n into two parts, say, r and s, so that r^2 + s^2 is minimal, then a(n) = r^2 + s^2. Geometrical significance: folding a rod with length n units at right angles in such a way that the end points are at the least distance, which is given by a(n)^(1/2) as the hypotenuse of a right triangle with the sum of the base and height = n units. - Amarnath Murthy, Apr 18 2004
Convolution of A002061(n)-0^n and (-1)^n. Convolution of n (A001477) with {1,0,2,0,2,0,2,...}. Partial sums of repeated odd numbers {0,1,1,3,3,5,5,...}. - Paul Barry, Jul 22 2004
The ratio of the sum of terms over the total number of terms in an n X n spiral. The sum of terms of an n X n spiral is A037270, or Sum_{k=0..n^2} k = (n^4 + n^2)/2 and the total number of terms is n^2. - William A. Tedeschi, Feb 27 2008
Starting with offset 1 = row sums of triangle A158946. - Gary W. Adamson, Mar 31 2009
Partial sums of A109613. - Reinhard Zumkeller, Dec 05 2009
Also the number of compositions of even natural numbers into 2 parts < n. For example a(3)=5 are the compositions (0,0), (0,2), (2,0), (1,1), (2,2) of even natural numbers into 2 parts < 3. a(4)=8 are the compositions (0,0), (0,2), (2,0), (1,1), (2,2), (1,3), (3,1), (3,3) of even natural numbers into 2 parts < 4. - Adi Dani, Jun 05 2011
A001105 and A001844 interleaved. - Omar E. Pol, Sep 18 2011
Number of (w,x,y) having all terms in {0,...,n} and w=average(x,y). - Clark Kimberling, May 15 2012
For n > 0, minimum number of lines necessary to get through all unit cubes of an n X n X n cube (see Kantor link). - Michel Marcus, Apr 13 2013
Sum_{n > 0} 1/a(n) = Sum_{n > 0} 1/(2*n^2) + Sum_{n >= 0} 1/(2*n + 2*n^2 + 1) = (zeta(2) + (Pi* tanh(Pi/2)))/2 = 2.26312655.... - Enrique Pérez Herrero, Jun 17 2013
For n > 1, a(n) is the edge cover number of the n X n king graph. - Eric W. Weisstein, Jun 20 2017
Also the number of vertices in the n X n black bishop graph. - Eric W. Weisstein, Jun 26 2017
The same sequence arises in the triangular array of the integers >= 1, according to a simple "zig-zag" rule for selection of terms. a(n-1) lies in the (n-1)-th row of the array, and the second row of that sub-array (with apex a(n-1)) contains just two numbers, one odd, one even. The one with opposite parity to a(n-1) is a(n). - David James Sycamore, Jul 29 2018
Size of minimal ternary 1-covering code with code length n, i.e., K_n(3,1). See Kalbfleisch and Stanton. - Patrick Wienhöft, Jan 29 2019
For n > 1, a(n-1) is the maximum number of inversions in a permutation consisting of a single n-cycle on n symbols. - M. Ryan Julian Jr., Sep 10 2019
Also the number of classes of convex inscribed polyominoes in a (2,n) rectangular grid; two polyominoes are in the same class if one of them can be obtained by a reflection or 180-degree rotation of the other. - Jean-Luc Manguin, Jan 29 2020
a(n) is the number of pairs (p,q) such that 1 <= p, p+1 < q <= n+2 and q <> 2*p. - César Eliud Lozada, Oct 25 2020
a(n) is the maximum number of copies of a 12 permutation pattern in an alternating (or zig-zag) permutation of length n+1. The maximum number of copies of 123 in an alternating permutation is motivated in the Notices reference, and the argument here is analogous. - Lara Pudwell, Dec 01 2020
It appears that a(n) is the largest number of nodes of an induced path in the n X n king graph. An induced path going in a simple spiraling pattern, starting in a corner, has a(n) nodes. For even n this is optimal, because an induced path can have at most two nodes in any 2 X 2 subsquare. For odd n, I cannot see how to prove that (n^2+1)/2 is best possible. See also A357501. - Pontus von Brömssen, Oct 02 2022 [Proved by Beluhov (2023). - Pontus von Brömssen, Jan 30 2023]
a(n) = n + 2*(n-2) + 2*(n-4) + 2*(n-6) + ... number of black squares on an n X n chessboard. - R. J. Mathar, Dec 03 2022
REFERENCES
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).
LINKS
Nikolai Beluhov, Snake paths in king and knight graphs, arXiv:2301.01152 [math.CO], 2023.
M. Benoumhani and M. Kolli, Finite topologies and partitions, JIS 13 (2010) # 10.3.5, t_{N0}(n,4) in theorem 5.
Andrea C. Burgess, Caleb W. Jones, and David A. Pike, Extending Graph Burning to Hypergraphs, arXiv:2403.01001 [math.CO], 2024. See p. 9.
Geoffrey B. Campbell, Vector Partition Identities for 2D, 3D and nD Lattices, arXiv:2302.01091 [math.CO], 2023.
J. G. Kalbfleisch and R. G. Stanton, A combinatorial problem in matching, J. London Math. Soc. Vol. 1, No. 1 (1969), 60-64. [Corrected by N. J. A. Sloane, Feb 08 2019]
J. M. Kantor, Mathématiques venues d'ailleurs: divertissements mathématiques en U.R.S.S., Le cube transpercé, pp. 56-62, Belin, Paris, 1982.
S. Lafortune, A. Ramani, B. Grammaticos, Y. Ohta, and K.M. Tamizhmani, Blending two discrete integrability criteria: ..., arXiv:nlin/0104020 [nlin.SI], 2001.
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
Eric Weisstein's World of Mathematics, Black Bishop Graph
Eric Weisstein's World of Mathematics, Edge Cover Number
Eric Weisstein's World of Mathematics, King Graph
Eric Weisstein's World of Mathematics, Topology
Eric Weisstein's World of Mathematics, Vertex Count
FORMULA
a(2*n) = 2*n^2, a(2*n+1) = 2*n^2 + 2*n + 1.
G.f.: -x*(1+x^2) / ( (1+x)*(x-1)^3 ). - Simon Plouffe in his 1992 dissertation
From Benoit Cloitre, Nov 06 2002: (Start)
a(n) = (2*n^2 + 1 - (-1)^n) / 4.
a(0)=0, a(1)=1; for n>1, a(n+1) = n + 1 + max(2*floor(a(n)/2), 3*floor(a(n)/3)). (End)
G.f.: (x + x^2 + x^3 + x^4)/((1 - x)*(1 - x^2)^2), not reduced. - Len Smiley
a(n) = a(n-2) + 2n - 2. - Paul Barry, Jul 17 2004
From Paul Barry, Jul 22 2004: (Start)
G.f.: x*(1+x^2)/((1-x^2)*(1-x)^2) = x*(1+x^2)/((1+x)*(1-x)^3);
a(n) = Sum_{k=0..n} (k^2 - k + 1 - 0^k)*(-1)^(n-k);
a(n) = Sum_{k=0..n} (1 + (-1)^(n-k) - 0^(n-k))*k. (End)
From Reinhard Zumkeller, Feb 27 2006: (Start)
a(0) = 0, a(n+1) = a(n) + 2*floor(n/2) + 1.
a(n) = A116940(n) - A005843(n). (End)
Starting with offset 1, = row sums of triangle A134444. Also, with offset 1, = binomial transform of [1, 1, 2, -2, 4, -8, 16, -32, ...]. - Gary W. Adamson, Oct 25 2007
a(n) = floor((n^2+1)/2). - William A. Tedeschi, Feb 27 2008
a(n) = A004526(n+1) + A000217(n-1). - Yosu Yurramendi, Sep 12 2008, corrected by Klaus Purath, Jun 15 2021
From Jaume Oliver Lafont, Dec 05 2008: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) + 2.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). (End)
a(n) = A004526(n)^2 + A110654(n)^2. - Philippe Deléham, Mar 12 2009
a(n) = n^2 - floor(n^2/2). - Wesley Ivan Hurt, Jun 14 2013
Euler transform is length 4 sequence [2, 2, 0, -1].
a(n) = a(-n) for all n in Z. - Michael Somos, May 05 2015
a(n) is also the number of independent entries in a centrosymmetric n X n matrix: M(i, j) = M(n-i+1, n-j+1). - Wolfdieter Lang, Oct 12 2015
For n > 1, a(n+1)/a(n) = 3 - A081352(n-2)/a(n). - Miko Labalan, Mar 26 2016
E.g.f.: (1/2)*(x*(1 + x)*cosh(x) + (1 + x + x^2)*sinh(x)). - Stefano Spezia, Feb 03 2020
a(n) = binomial(n+1,2) - floor(n/2). - César Eliud Lozada, Oct 25 2020
From Klaus Purath, Jun 15 2021: (Start)
a(n-1) + a(n) = A002061(n).
a(n) = (a(n-1)^2 + 1) / a(n-2), n >= 3 odd.
a(n) = (a(n-1)^2 - (n-1)^2) / a(n-2), n >= 4 even. (End)
EXAMPLE
G.f. = x + 2*x^2 + 5*x^3 + 8*x^4 + 13*x^5 + 18*x^6 + 25*x^7 + 32*x^8 + ...
Centrosymmetric 3 X 3 matrix: [[a,b,c],[d,e,d],[c,b,a]], a(3) = 3*(3-1)/2 + (3-1)/2 + 1 = (3^2+1)/2 = 5 from a,b,c,d,e. 4 X 4 case: [[a,b,c,d],[e,f,g,h],[h,g,f,e],[d,c,b,a]], a(4) = 4*4/2 = 8. - Wolfdieter Lang, Oct 12 2015
a(3) = 5. The alternating permutation of length 3 + 1 = 4 with the maximum number of copies of 123 is 1324. The five copies are 12, 13, 14, 23, and 24. - Lara Pudwell, Dec 01 2020
MAPLE
seq( ceil(n^2/2), n=0..30) ; # R. J. Mathar, Jun 05 2011
MATHEMATICA
Table[Ceiling[n^2/2], {n, 0, 120}] (* Vladimir Joseph Stephan Orlovsky, Apr 02 2011 *)
Accumulate[Join[{0}, (# - Boole[EvenQ[#]] &) /@ Range[80]]] (* Alonso del Arte, Sep 11 2019 *)
PROG
(Magma) [(2*n^2 + 1 - (-1)^n) / 4: n in [0..60]]; // Vincenzo Librandi, Jun 16 2011
(Haskell)
a000982 = (`div` 2) . (+ 1) . (^ 2) -- Reinhard Zumkeller, Jun 27 2013
(PARI) a(n)=(n^2+1)\2 \\ Charles R Greathouse IV, Sep 13 2013
(PARI) x='x+O('x^100); concat([0], Vec(x*(1+x^2)/((1+x)*(1-x)^3))) \\ Altug Alkan, Oct 12 2015
(PARI) apply( A000982(n)=n^2\/2, [0..55]) \\ M. F. Hasler, Feb 29 2020
(Scala) (((1 to 49) by 2) flatMap { List.fill(2)(_) }).scanLeft(0)(_ + _) // Alonso del Arte, Sep 11 2019
(Python)
def A000982(n): return n**2+1>>1 # Chai Wah Wu, Aug 28 2023
KEYWORD
nonn,easy
STATUS
approved