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.

Showing 1-9 of 9 results.

A000982 a(n) = ceiling(n^2/2).

Original entry on oeis.org

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

Views

Author

Keywords

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

Examples

			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
		

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).

Crossrefs

Programs

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)

A116940 Greatest m such that A116939(m) = n.

Original entry on oeis.org

0, 3, 6, 11, 16, 23, 30, 39, 48, 59, 70, 83, 96, 111, 126, 143, 160, 179, 198, 219, 240, 263, 286, 311, 336, 363, 390, 419, 448, 479, 510, 543, 576, 611, 646, 683, 720, 759, 798, 839, 880, 923, 966, 1011, 1056, 1103, 1150, 1199, 1248, 1299, 1350, 1403, 1456
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 27 2006

Keywords

Comments

From Andrew Rupinski, Nov 30 2009: (Start)
For n > 0, a(n) appears to be the set such that binomial(2*a(n),r) - binomial(2*a(n),r-2) = binomial(2*a(n),s) - binomial(2*a(n),s-2) for some r != s.
As a consequence of the Weyl Dimension Formula and the above comment, a(n) also appears to be the indices k such that the Symplectic Group Sp(k) has two fundamental irreducible representations of the same dimension. (End)

Examples

			a(n) = A000982(n) + A005843(n).
From _Andrew Rupinski_, Nov 30 2009: (Start)
a(1) = 3 and binomial(6,3)-binomial(6,1) = binomial(6,2)-binomial(6,0).
a(1) = 3 and the fundamental representations of Sp(3) are of dimensions 6, 14 and 14. a(2) = 6 and the fundamental representations of Sp(6) are of dimensions 12, 65, 208, 429, 572, and 429. (End)
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a116940 n = last $ elemIndices n $ takeWhile (<= n + 1) a116939_list
    -- Reinhard Zumkeller, Jun 28 2013
    
  • Magma
    [(2*n*(n+4) -(-1)^n +1)/4: n in [0..55]]; // G. C. Greubel, Jan 26 2020
    
  • Maple
    seq( (2*(n+2)^2 -(-1)^n -7)/4, n=0..55); # G. C. Greubel, Jan 26 2020
  • Mathematica
    a = {0}; Do[AppendTo[a, If[Count[a, #-1] > #-1, #+1, #-1]] &@ a[[n]], {n, 1500}]; Most@ Values@ Map[Last, PositionIndex@ a] - 1 (* Michael De Vlieger, Dec 07 2016, Version 10 *)
    Table[(2*(n+2)^2 -(-1)^n -7)/4, {n,0,55}] (* G. C. Greubel, Jan 26 2020 *)
  • PARI
    vector(56, n, (2*(n+1)^2 +(-1)^n -7)/4) \\ G. C. Greubel, Jan 26 2020
    
  • Sage
    [(2*n*(n+4) -(-1)^n +1)/4 for n in (0..55)] # G. C. Greubel, Jan 26 2020

Formula

a(0) = 0, a(n+1) = a(n) + 2*floor(n/2) + 3.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Joerg Arndt, Apr 02 2011
G.f.: x*(3 - x^2)/((1 + x)*(1 - x)^3). - Arkadiusz Wesolowski, Jan 01 2012
a(n) = 2n + ceiling(n^2/2). - Wesley Ivan Hurt, Jun 14 2013
a(n) = (2*n*(n + 4) - (-1)^n + 1)/4. - Bruno Berselli, Jun 14 2013
a(n) = A081352(n) - A236283(n + 1). - Miko Labalan, Dec 04 2016
From Klaus Purath, Jan 26 2020: (Start)
a(n) = binomial(n+2, 2) + floor((n-1)/2).
a(n) = floor(A028884(n)/2) - n.
a(n) = (n+1)^2 - A099392(n+1).
a(2*n)^2 - a(2*n-1)*a(2*n+1) = 3, n > 0.
a(2*n+1)^2 - a(2*n)*a(2*n+2) = (2*n+3)^2. (End)
E.g.f.: (1/2)*(x*(5 + x)*cosh(x) + (1 + 5*x + x^2)*sinh(x)). - Stefano Spezia, Jan 26 2020
a(n) = A000217(2*n) - 2*A001859(n-1) for n>0. - John Tyler Rascoe, Jul 31 2022
Sum_{n>=1} 1/a(n) = 11/8 + tan(sqrt(3)*Pi/2)*Pi/(2*sqrt(3)). - Amiram Eldar, Sep 16 2022

A236283 The number of orbits of triples of {1,2,...,n} under the action of the dihedral group of order 2n.

Original entry on oeis.org

1, 4, 5, 10, 13, 20, 25, 34, 41, 52, 61, 74, 85, 100, 113, 130, 145, 164, 181, 202, 221, 244, 265, 290, 313, 340, 365, 394, 421, 452, 481, 514, 545, 580, 613, 650, 685, 724, 761, 802, 841, 884, 925, 970, 1013, 1060, 1105, 1154, 1201, 1252
Offset: 1

Views

Author

W. Edwin Clark, Jan 21 2014

Keywords

Comments

In other words, a(n) is the number of equivalence classes of length 3 words with an alphabet of size n where equivalence is up to rotation or reflection of the alphabet. For example when n is 3, the word 112 is equivalent to 223 and 331 by rotation of the alphabet, and these are equivalent to 332, 221 and 113 by reflection of the alphabet. - Andrew Howroyd, Jan 17 2020

Examples

			For n = 3 there are 5 orbits of triples:
[[1,1,1], [2,2,2], [3,3,3]],
[[1,1,2], [2,2,3], [1,1,3], [3,3,1], [3,3,2], [2,2,1]],
[[1,2,1], [2,3,2], [1,3,1], [3,1,3], [3,2,3], [2,1,2]],
[[1,2,2], [2,3,3], [1,3,3], [3,1,1], [3,2,2], [2,1,1]],
[[1,2,3], [2,3,1], [1,3,2], [3,1,2], [3,2,1], [2,1,3]].
		

Crossrefs

Cf. A236332 (4-tuples).

Programs

  • GAP
    a:=function(n)
    local g,orbs;
    g:=DihedralGroup(IsPermGroup,2*n);
    orbs := OrbitsDomain(g, Tuples( [ 1 .. n ], 3), OnTuples );
    return Size(orbs);
    end;;
    
  • PARI
    a(n) = {(5 + 3*(-1)^n + 2*n^2)/4} \\ Andrew Howroyd, Jan 17 2020

Formula

Conjectures from Colin Barker, Jan 21 2014: (Start)
a(n) = (5 + 3*(-1)^n + 2*n^2)/4.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: -x*(2*x^3-3*x^2+2*x+1) / ((x-1)^3*(x+1)).
(End)
From Andrew Howroyd, Jan 17 2020: (Start)
The above conjectures are true and can be derived from the following formulas for even and odd n.
a(n) = (n-2)*(n + 2)/2 + 4 for even n.
a(n) = (n-1)*(n + 1)/2 + 1 for odd n.
(End)
a(n) = A081352(n - 1) - A116940(n - 1). - Miko Labalan, Nov 12 2016

A081349 Square maze arrangement of the natural numbers, read by antidiagonals.

Original entry on oeis.org

1, 2, 8, 3, 7, 9, 4, 6, 10, 24, 15, 5, 11, 23, 25, 16, 14, 12, 22, 26, 48, 35, 17, 13, 21, 27, 47, 49, 36, 34, 18, 20, 28, 46, 50, 80, 63, 37, 33, 19, 29, 45, 51, 79, 81, 64, 62, 38, 32, 30, 44, 52, 78, 82, 120, 99, 65, 61, 39, 31, 43, 53, 77, 83, 119, 121, 100, 98, 66, 60, 40
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Examples

			Starting with 1,2,3,4, turn (LL) and then repeat (RRR)(LLL) to get:
.
   1   8---9  24 ...
   |   |   |   |
   2   7  10  23 ...
   |   |   |   |
   3   6  11  22 ...
   |   |   |   |
   4---5  12  21 ...
           |   |
  15--14--13  20 ...
   |           |
  16--17--18--19 ...
  ...
		

Crossrefs

First row is A081351. First column is A081350.
Main diagonal is A081352. Main subdiagonal is 2*A000217(n+1).

A081350 First column in maze array of natural numbers A081349.

Original entry on oeis.org

1, 2, 3, 4, 15, 16, 35, 36, 63, 64, 99, 100, 143, 144, 195, 196, 255, 256, 323, 324, 399, 400, 483, 484, 575, 576, 675, 676, 783, 784, 899, 900, 1023, 1024, 1155, 1156, 1295, 1296, 1443, 1444, 1599, 1600, 1763, 1764, 1935, 1936, 2115, 2116, 2303, 2304, 2499
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Comments

Interleaves A000466 with even squares A016742.

Crossrefs

Formula

a(0)=1, a(1)=2, a(n)=(n-1)*(n+(-1)^n), n>1.
G.f.: -(2*x^6-10*x^4+x^3+x^2-x-1)/((1-x)^3*(1+x)^2). [Colin Barker, Sep 03 2012]

A081351 First row in square maze array of natural numbers A081349.

Original entry on oeis.org

1, 8, 9, 24, 25, 48, 49, 80, 81, 120, 121, 168, 169, 224, 225, 288, 289, 360, 361, 440, 441, 528, 529, 624, 625, 728, 729, 840, 841, 960, 961, 1088, 1089, 1224, 1225, 1368, 1369, 1520, 1521, 1680, 1681, 1848, 1849, 2024, 2025, 2208, 2209, 2400, 2401, 2600
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Comments

Interleaves the odd squares A016754 with 8 times the triangular numbers A000217.

Crossrefs

Programs

Formula

a(n) = (n+1)*(n+2)-(n+1)*(-1)^n = 2*C(n+2,2)-C(n+1,1)*(-1)^n.
G.f.: (x^3-x^2+7*x+1)/((1-x)^3*(1+x)^2). [Colin Barker, Sep 03 2012]

A081353 Diagonal of square maze arrangement of natural numbers A081349.

Original entry on oeis.org

3, 5, 13, 19, 31, 41, 57, 71, 91, 109, 133, 155, 183, 209, 241, 271, 307, 341, 381, 419, 463, 505, 553, 599, 651, 701, 757, 811, 871, 929, 993, 1055, 1123, 1189, 1261, 1331, 1407, 1481, 1561, 1639, 1723, 1805, 1893, 1979, 2071, 2161, 2257, 2351, 2451, 2549
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Crossrefs

Bisections are in A054554, A125202.

Programs

Formula

a(n) = (n+1)*(n+2)+(-1)^n = 2*binomial(n+2,2)+(-1)^n.
G.f.: (3-x)*(1+x^2)/((1-x)^3*(1+x)). [Colin Barker, Sep 03 2012]
From Wesley Ivan Hurt, Aug 09 2015: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>4.
a(n) = n^2+3n+3 if n is even, otherwise n^2+3n+1.
a(n) = A137932(n+3) - A109613(n+1). (End)

A179783 a(n) = 2*n*(n+1)*(n+2)/3 + (-1)^n.

Original entry on oeis.org

1, 3, 17, 39, 81, 139, 225, 335, 481, 659, 881, 1143, 1457, 1819, 2241, 2719, 3265, 3875, 4561, 5319, 6161, 7083, 8097, 9199, 10401, 11699, 13105, 14615, 16241, 17979, 19841, 21823, 23937, 26179, 28561, 31079
Offset: 0

Views

Author

Bruno Berselli, Jul 29 2010 - Sep 07 2010

Keywords

Comments

First differences in 2*A081352.
Second differences in 4*A004442.

Crossrefs

Programs

  • Magma
    [(2/3)*n*(n+1)*(n+2)+(-1)^n: n in [0..35]];
    
  • Mathematica
    LinearRecurrence[{3,-2,-2,3,-1},{1,3,17,39,81},40] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    for(n=0, 35, print1((2/3)*n*(n+1)*(n+2)+(-1)^n", "));

Formula

G.f.: (1+10*x^2-4*x^3+x^4)/((1+x)*(1-x)^4); exp(-x)+(2/3)*exp(x)*x*(6+6*x+x^2).
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5) for n>4.
a(n) = 4*A000292(n)+(-1)^n.

A126950 a(1) = 1; for n>1, a(n) = the smallest number p > a(n-1) such that (a(n-1)+p)/2 is a cube.

Original entry on oeis.org

1, 15, 39, 89, 161, 271, 415, 609, 849, 1151, 1511, 1945, 2449, 3039, 3711, 4481, 5345, 6319, 7399, 8601, 9921, 11375, 12959, 14689, 16561, 18591, 20775, 23129, 25649, 28351, 31231, 34305, 37569, 41039, 44711, 48601, 52705, 57039, 61599, 66401
Offset: 1

Views

Author

Zak Seidov, Mar 18 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Table[((2*n +1)*(2*n^2 + 2*n -1)+ 5*(-1)^n)/4,{n,83}]

Formula

a(n) = ((2*n +1)*(2*n^2 + 2*n -1)+ 5*(-1)^n)/4; a(n) = a(n-1)+2n^3; G.f. = (1 - 2*x + 14*x^2 - 2*x^3 + x^4)/((1 + x)(1 - x)^4).
Showing 1-9 of 9 results.