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-10 of 58 results. Next

A083479 The natural numbers with all terms of A033638 inserted.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 57
Offset: 0

Views

Author

Alford Arnold, Jun 08 2003

Keywords

Comments

Row n of A049597 has a(n+1) nonzero values.
When considering the set of nested parabolas defined by -(x^2) + p*x for integer values of p, a(n) tells us how many parabolas are intersected by the line from (1,n) to (n,n). - Gregory R. Bryant, Apr 01 2013
Number of distinct perimeters for polyominoes with n square cells. - Wesley Prosser, Sep 06 2017

Examples

			There are three 1's, one from the natural numbers and two from A033638.
When viewed as an array the sequence begins:
   0
   1
   1  1
   2  2
   3  3  4
   5  5  6
   7  7  8  9
  10 10 11 12
  13 13 14 15 16
  17 17 18 19 20
  21 21 22 23 24 25
  26 26 27 28 29 30
  ...
		

Crossrefs

Programs

  • Haskell
    a083479 n = a083479_list !! n
    a083479_list = m [0..] a033638_list where
       m xs'@(x:xs) ys'@(y:ys) | x <= y    = x : m xs ys'
                               | otherwise = y : m xs' ys
    -- Reinhard Zumkeller, Apr 06 2012
    
  • Magma
    [n eq 0 select 0 else (n+2)-Ceiling(Sqrt(4*n)): n in [0..100]]; // G. C. Greubel, Feb 17 2024
    
  • Mathematica
    Table[(n + 2) - Ceiling@ Sqrt[4 n] - 2 Boole[n == 0], {n, 0, 73}] (* Michael De Vlieger, Sep 05 2017 *)
  • Maxima
    a(n):=((n+2)-ceiling(sqrt(4*n))); /* Gregory R. Bryant, Apr 01 2013 */
    
  • Python
    from math import isqrt
    def A083479(n): return n+1-isqrt((n<<2)-1) if n else 0 # Chai Wah Wu, Jul 28 2022
    
  • SageMath
    [(n+2)-ceil(sqrt(4*n)) -2*int(n==0) for n in range(101)] # G. C. Greubel, Feb 17 2024

Formula

a(n) = (n+2) - ceiling(sqrt(4*n)), for n > 0. - Gregory R. Bryant, Apr 01 2013
From Wesley Prosser, Sep 06 2017: (Start)
a(n) = (n+2) - A027709(n)/2.
a(n) = (n+2) - A027434(n).
a(n) = (2n+2) - A049068(n).
a(n) = (2n+3) - A080037(n).
(End)

Extensions

Edited and extended by David Wasserman, Nov 16 2004

A265410 a(n) = one-based index to the nearest horizontally or vertically adjacent inner neighbor in square-grid spirals, and to the nearest diagonally adjacent inner neighbor when n is one of the corner cases A033638.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 10, 10, 10, 11, 12, 13, 13, 13, 14, 15, 16, 17, 17, 17, 18, 19, 20, 21, 21, 21, 22, 23, 24, 25, 26, 26, 26, 27, 28, 29, 30, 31, 31, 31, 32, 33, 34, 35, 36, 37, 37, 37, 38, 39, 40, 41, 42, 43, 43, 43, 44, 45, 46, 47, 48, 49, 50, 50, 50, 51, 52, 53, 54, 55, 56, 57, 57, 57, 58, 59, 60, 61, 62, 63, 64, 65, 65
Offset: 1

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

By convention: a(1) = 0 because as 1 is a starting point of such spirals, it has no "inner neighbors" for itself.
Each n occurs A265411(n) times.

Examples

			We arrange natural numbers as a counterclockwise spiral into the square grid in the following manner (here A stands for 10, B for 11 and C for 12). The first square corresponds with n, and the second square with the value of a(n):
                    55433
            543C    51113C
            612B    61012B
            789A    71122A
                    7789AA
-
For each n > 1, we look for the nearest horizontally or vertically adjacent neighbor of n towards the center that is not n-1, which will then be value of a(n) [e.g., it is 1 for 4, 6 and 8, while it is 2 for 9 and 11 and 3 for 12] unless n is in the corner (one of the terms of A033638), in which case the value is the nearest diagonally adjacent neighbor towards the center.
		

Crossrefs

One more than A265409(n-1).
Cf. A265400 (a variant).
Cf. A265411, A265412, A265413 (positions of records, i.e., where value increases).

Formula

a(1) = 0; for 1 < n < 8, a(n) = 1 and for n >= 8: if either A240025(n-1) or A240025(n-2) is not zero [when n or n-1 is in A033638], then a(n) = a(n-1), otherwise, a(n) = 1 + a(n-1).
a(1) = 0; for 1 < n < 8, a(n) = 1 and for n >= 8: a(n) = a(n-1) + (1-A240025(n-1))*(1-A240025(n-2)). [The same formula in a more compact form.]
Other identities. For all n >= 0:
a(A265413(n)) = n. [Sequence is the least monotonic left inverse of A265413.]
a(A265412(n)) = n. [Also inverse of A265412.]

A265411 a(0) = 1, a(1) = 7, otherwise, if A240025(n-1) = 1 [when n is in A033638] a(n) = 3, otherwise a(n) = 1.

Original entry on oeis.org

1, 7, 3, 3, 1, 3, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3
Offset: 0

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

Each n occurs a(n) times in A265410.

Crossrefs

Cf. A265410, A265412 (partial sums).

Programs

  • Scheme
    (define (A265411 n) (cond ((zero? n) 1) ((= 1 n) 7) ((= 1 (A240025 (- n 1))) 3) (else 1)))

Formula

a(0) = 1, a(1) = 7, otherwise, if A240025(n-1) = 1 [when n is in A033638] a(n) = 3, otherwise a(n) = 1.

A172979 Primes with locations of right angle turns in Ulam square spiral (primes in A033638).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 43, 73, 101, 157, 197, 211, 241, 257, 307, 401, 421, 463, 577, 601, 677, 757, 1123, 1297, 1483, 1601, 1723, 2551, 2917, 2971, 3137, 3307, 3541, 3907, 4357, 4423, 4831, 5113, 5477, 5701, 6007, 6163, 6481, 7057, 8011, 8101, 8191, 8837, 9901
Offset: 1

Views

Author

Michel Lagneau, Nov 21 2010

Keywords

Comments

Except for the first term, 2, these are the primes on the main diagonals of the Ulam spiral. - Robert G. Wilson v, Jul 10 2014
Primes p for which floor(sqrt(p)) | (p-1). - Davide Rotondo, Jun 06 2025

Examples

			Ulam square spiral = 7 8 9 / 6 1 2 / 5 4 3 /...; changes of direction (right-angle)
  for the primes at 2 3 5 7 ...
		

Crossrefs

Programs

  • Maple
    with(numtheory): a0:=1:for n from 1 to 200 do : a1:=a0+floor(n/2):a0:=a1:if
      type(a1,prime)=true then printf(`%d, `,a1):else fi:od:
  • Mathematica
    Select[ Sort@ Flatten@ Table[ 4n^2 + (2j - 4)n + 1, {j, 0, 3}, {n, 55}], PrimeQ]
  • PARI
    for(n=0,10^3, my(t=n^2\4+1); if(isprime(t),print1(t,", "))); \\ Joerg Arndt, Jul 12 2014

A265400 a(n) = one-based index to the nearest horizontally or vertically adjacent inner neighbor in square-grid spirals, or 0 if n is one of the corner cases A033638.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 3, 0, 3, 4, 5, 0, 5, 6, 7, 0, 7, 8, 9, 10, 0, 10, 11, 12, 13, 0, 13, 14, 15, 16, 17, 0, 17, 18, 19, 20, 21, 0, 21, 22, 23, 24, 25, 26, 0, 26, 27, 28, 29, 30, 31, 0, 31, 32, 33, 34, 35, 36, 37, 0, 37, 38, 39, 40, 41, 42, 43, 0, 43, 44, 45, 46, 47, 48, 49, 50, 0, 50, 51, 52, 53, 54, 55, 56, 57, 0, 57, 58, 59, 60, 61, 62, 63, 64, 65, 0
Offset: 1

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

By convention we set a(1) = 0, because as 1 is a starting point of such spirals, it has no "inner neighbors" for itself.
This sequence is useful when constructing spiral-based sequences like A260643.

Examples

			We arrange natural numbers as a counterclockwise spiral into the square grid in the following manner (here A stands for 10, B for 11 and C for 12). The first square corresponds with n, and the second square with the value of a(n):
                    05430
            543C    50103
            612B    61002
            789A    70120
                    0789A0
-
For each n > 1, we look for the nearest horizontally or vertically adjacent neighbor of n towards the center that is not n-1, which will then be value of a(n) [e.g., it is 1 for 4, 6 and 8, while it is 2 for 9 and 11 and 3 for 12] unless no such additional neighbor exists, in which case a(n) = 0 (this occurs when n is one of the A033638, Quarter-squares plus 1).
		

Crossrefs

Cf. A000035, A000267, A033638 (positions of zeros), A240025, A260643.
Cf. A265410 (a variant).

Formula

If A240025(n-1) = 1 [when n is in A033638], then a(n) = 0, otherwise a(n) = A265410(n).
a(1) = a(2) = 0. If 3 <= n <= 8, then a(n) = 1 - (n mod 2), and for n >= 8, if A240025(n-1) is not zero [when n is in A033638], then a(n) = 0, otherwise, if A240025(n-2) is not zero [when n is one more than some term of A033638], then a(n) = A033638(A000267(n)-4), otherwise, a(n) = 1 + a(n-1).

A201143 Irregular triangular array read by rows T(n,k) is the number of 2-colored labeled graphs that have exactly k edges, n >= 2, 0 <= k <= A033638(n).

Original entry on oeis.org

1, 1, 3, 6, 3, 7, 24, 30, 16, 3, 15, 80, 180, 220, 155, 60, 10, 31, 240, 840, 1740, 2340, 2106, 1260, 480, 105, 10, 63, 672, 3360, 10360, 21840, 33054, 36757, 30240, 18270, 7910, 2331, 420, 35, 127, 1792, 12096, 51520, 154280, 343392, 586488, 782944, 824670, 686840, 450296, 229656, 89208, 25480, 5040, 616, 35
Offset: 2

Views

Author

Geoffrey Critzer, Nov 27 2011

Keywords

Comments

In each such graph: (i) no two nodes of the same color are adjacent, (ii) the colors are interchangeable, and (iii) there must be at least one vertex of each color.

Examples

			Triangle begins:
   1,   1;
   3,   6,   3;
   7,  24,  30,   16,    3;
  15,  80, 180,  220,  155,   60,   10;
  31, 240, 840, 1740, 2340, 2106, 1260, 480, 105, 10;
		

References

  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, page 16.

Crossrefs

Row sums are A058872.
Row lengths appear to be A033638(n).

Programs

  • Mathematica
    Flatten[CoefficientList[Expand[Table[Sum[Binomial[n, k] (1 + x)^(k (n - k)), {k, 1, n - 1}]/2!, {n, 1,7}]], x]]
  • PARI
    Row(n) = {Vecrev(sum(k=1, n-1, binomial(n,k)*(1+x)^(k*(n-k))/2))}
    { for(n=2, 8, print(Row(n))) } \\ Andrew Howroyd, Apr 18 2021

Formula

O.g.f. of row n: Sum_{k=0..n-1} binomial(n,k)*(1+x)^(k*(n-k))/2.

Extensions

Terms a(42) and beyond from Andrew Howroyd, Apr 18 2021

A331997 Semiprimes m = p*q where m, p and q are in A033638 (locations of right angle turns in Ulam square spiral).

Original entry on oeis.org

10, 21, 26, 65, 91, 111, 785, 842, 1333, 4097, 21171, 28562, 50851, 100807, 194923, 970226, 1000001, 37021141, 65618101, 81144065, 151782401, 151819363, 174134417, 577921601, 688773781, 796622401, 796678851, 1276025563, 2090501285, 2176782337, 3662246773, 6059299123, 6879790081
Offset: 1

Views

Author

Michel Lagneau, Feb 04 2020

Keywords

Comments

The sequence is probably infinite.
A geometric property of the sequence: consider the first diagonal with numbers of the form f(k) = k^2 + k + 1 in the Ulam spiral. The semiprimes and their prime factors belonging to the diagonal are given by the subsequence: 21, 91, 1333, 50851, 194923, 37021141, 65618101, 151819363, 688773781, 796622401, 1276025563, 3662246773, 6059299123, 6879790081, ... (see the illustration). This subsequence is the result of the following property: f(k)*f(k+1) = f((k+1)^2).
Examples:
21 = 3*7 = f(1)*f(2) = f(4);
91 = 7*13 = f(2)*f(3) = f(9);
1333 = 31*43 = f(5)*f(6) = f(36);
................................
This subsequence is probably infinite.

Examples

			111 is in the sequence because 111 = 3*37, and the numbers 3, 37 and 111 are in A033638.
		

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=10^5:T1:=1:
    lst:={1}:lst1:={}:
      for n from 2 to nn do:
       T2:= T1 + floor(n/2):lst:=lst union {T2}:T1:=T2:
      od:
          for j from 2 to nn do:
            x:=lst[j]:d:=factorset(x):n0:=nops(d):
              if n0=2 and bigomega(x)=2
               and {d[1],d[2]} intersect lst = {d[1],d[2]}
               then
               lst1:=lst1 union {lst[j]}
               else
               fi:
              od:
              sort(lst1);
  • PARI
    lista(nn) = {my(vn = vector(nn, k, k^2\4 + 1)); for (i=1, #vn, if (bigomega(vn[i]) == 2, my(f=factor(vn[i])); my(p=f[1,1], q = f[2,1]); if (vecsearch(vn, p) && vecsearch(vn, q), print1(vn[i], ", "));););} \\ Michel Marcus, Feb 04 2020

Extensions

More terms from Michel Marcus, Jan 13 2025

A002620 Quarter-squares: a(n) = floor(n/2)*ceiling(n/2). Equivalently, a(n) = floor(n^2/4).

Original entry on oeis.org

0, 0, 1, 2, 4, 6, 9, 12, 16, 20, 25, 30, 36, 42, 49, 56, 64, 72, 81, 90, 100, 110, 121, 132, 144, 156, 169, 182, 196, 210, 225, 240, 256, 272, 289, 306, 324, 342, 361, 380, 400, 420, 441, 462, 484, 506, 529, 552, 576, 600, 625, 650, 676, 702, 729, 756, 784, 812
Offset: 0

Views

Author

Keywords

Comments

b(n) = a(n+2) is the number of multigraphs with loops on 2 nodes with n edges [so g.f. for b(n) is 1/((1-x)^2*(1-x^2))]. Also number of 2-covers of an n-set; also number of 2 X n binary matrices with no zero columns up to row and column permutation. - Vladeta Jovovic, Jun 08 2000
a(n) is also the maximal number of edges that a triangle-free graph of n vertices can have. For n = 2m, the maximum is achieved by the bipartite graph K(m, m); for n = 2m + 1, the maximum is achieved by the bipartite graph K(m, m + 1). - Avi Peretz (njk(AT)netvision.net.il), Mar 18 2001
a(n) is the number of arithmetic progressions of 3 terms and any mean which can be extracted from the set of the first n natural numbers (starting from 1). - Santi Spadaro, Jul 13 2001
This is also the order dimension of the (strong) Bruhat order on the Coxeter group A_{n-1} (the symmetric group S_n). - Nathan Reading (reading(AT)math.umn.edu), Mar 07 2002
Let M_n denote the n X n matrix m(i,j) = 2 if i = j; m(i, j) = 1 if (i+j) is even; m(i, j) = 0 if i + j is odd, then a(n+2) = det M_n. - Benoit Cloitre, Jun 19 2002
Sums of pairs of neighboring terms are triangular numbers in increasing order. - Amarnath Murthy, Aug 19 2002
Also, from the starting position in standard chess, minimum number of captures by pawns of the same color to place n of them on the same file (column). Beyond a(6), the board and number of pieces available for capture are assumed to be extended enough to accomplish this task. - Rick L. Shepherd, Sep 17 2002
For example, a(2) = 1 and one capture can produce "doubled pawns", a(3) = 2 and two captures is sufficient to produce tripled pawns, etc. (Of course other, uncounted, non-capturing pawn moves are also necessary from the starting position in order to put three or more pawns on a given file.) - Rick L. Shepherd, Sep 17 2002
Terms are the geometric mean and arithmetic mean of their neighbors alternately. - Amarnath Murthy, Oct 17 2002
Maximum product of two integers whose sum is n. - Matthew Vandermast, Mar 04 2003
a(n+2) gives number of non-symmetric partitions of n into at most 3 parts, with zeros used as padding. E.g., a(7) = 12 because we can write 5 = 5 + 0 + 0 = 0 + 5 + 0 = 4 + 1 + 0 = 1 + 4 + 0 = 1 + 0 + 4 = 3 + 2 + 0 = 2 + 3 + 0 = 2 + 0 + 3 = 2 + 2 + 1 = 2 + 1 + 2 = 3 + 1 + 1 = 1 + 3 + 1. - Jon Perry, Jul 08 2003
a(n-1) gives number of distinct elements greater than 1 of non-symmetric partitions of n into at most 3 parts, with zeros used as padding, appear in the middle. E.g., 5 = 5 + 0 + 0 = 0 + 5 + 0 = 4 + 1 + 0 = 1 + 4 + 0 = 1 + 0 + 4 = 3 + 2 + 0 = 2 + 3 + 0 = 2 + 0 + 3 = 2 + 2 + 1 = 2 + 1 + 2 = 3 + 1 + 1 = 1 + 3 + 1. Of these, 050, 140, 320, 230, 221, 131 qualify and a(4) = 6. - Jon Perry, Jul 08 2003
Union of square numbers (A000290) and oblong numbers (A002378). - Lekraj Beedassy, Oct 02 2003
Conjectured size of the smallest critical set in a Latin square of order n (true for n <= 8). - Richard Bean, Jun 12 2003 and Nov 18 2003
a(n) gives number of maximal strokes on complete graph K_n, when edges on K_n can be assigned directions in any way. A "stroke" is a locally maximal directed path on a directed graph. Examples: n = 3, two strokes can exist, "x -> y -> z" and " x -> z", so a(3) = 2. n = 4, four maximal strokes exist, "u -> x -> z" and "u -> y" and "u -> z" and "x -> y -> z", so a(4) = 4. - Yasutoshi Kohmoto, Dec 20 2003
Number of symmetric Dyck paths of semilength n+1 and having three peaks. E.g., a(4) = 4 because we have U*DUUU*DDDU*D, UU*DUU*DDU*DD, UU*DDU*DUU*DD and UUU*DU*DU*DDD, where U = (1, 1), D = (1, -1) and * indicates a peak. - Emeric Deutsch, Jan 12 2004
Number of valid inequalities of the form j + k < n + 1, where j and k are positive integers, j <= k, n >= 0. - Rick L. Shepherd, Feb 27 2004
See A092186 for another application.
Also, the number of nonisomorphic transversal combinatorial geometries of rank 2. - Alexandr S. Radionov (rasmailru(AT)mail.ru), Jun 02 2004
a(n+1) is the transform of n under the Riordan array (1/(1-x^2), x). - Paul Barry, Apr 16 2005
1, 2, 4, 6, 9, 12, 16, 20, 25, 30, ... specifies the largest number of copies of any of the gifts you receive on the n-th day in the "Twelve Days of Christmas" song. For example, on the fifth day of Christmas, you have 9 French hens. - Alonso del Arte, Jun 17 2005
a(n+1) is the number of noncongruent integer-sided triangles with largest side n. - David W. Wilson [Comment corrected Sep 26 2006]
A quarter-square table can be used to multiply integers since n*m = a(n+m) - a(n-m) for all integer n, m. - Michael Somos, Oct 29 2006
The sequence is the size of the smallest strong critical set in a Latin square of order n. - G.H.J. van Rees (vanrees(AT)cs.umanitoba.ca), Feb 16 2007
Maximal number of squares (maximal area) in a polyomino with perimeter 2n. - Tanya Khovanova, Jul 04 2007
For n >= 3 a(n-1) is the number of bracelets with n+3 beads, 2 of which are red, 1 of which is blue. - Washington Bomfim, Jul 26 2008
Equals row sums of triangle A122196. - Gary W. Adamson, Nov 29 2008
Also a(n) is the number of different patterns of a 2-colored 3-partition of n. - Ctibor O. Zizka, Nov 19 2014
Also a(n-1) = C(((n+(n mod 2))/2), 2) + C(((n-(n mod 2))/2), 2), so this is the second diagonal of A061857 and A061866, and each even-indexed term is the average of its two neighbors. - Antti Karttunen
Equals triangle A171608 * ( 1, 2, 3, ...). - Gary W. Adamson, Dec 12 2009
a(n) gives the number of nonisomorphic faithful representations of the Symmetric group S_3 of dimension n. Any faithful representation of S_3 must contain at least one copy of the 2-dimensional irrep, along with any combination of the two 1-dimensional irreps. - Andrew Rupinski, Jan 20 2011
a(n+2) gives the number of ways to make change for "c" cents, letting n = floor(c/5) to account for the 5-repetitive nature of the task, using only pennies, nickels and dimes (see A187243). - Adam Sasson, Mar 07 2011
a(n) belongs to the sequence if and only if a(n) = floor(sqrt(a(n))) * ceiling(sqrt(a(n))), that is, a(n) = k^2 or a(n) = k*(k+1), k >= 0. - Daniel Forgues, Apr 17 2011
a(n) is the sum of the positive integers < n that have the opposite parity as n.
Deleting the first 0 from the sequence results in a sequence b = 0, 1, 2, 4, ... such that b(n) is sum of the positive integers <= n that have the same parity as n. The sequence b(n) is the additive counterpart of the double factorial. - Peter Luschny, Jul 06 2011
Third outer diagonal of Losanitsch's Triangle, A034851. - Fred Daniel Kline, Sep 10 2011
Written as a(1) = 1, a(n) = a(n-1) + ceiling (a(n-1)) this is to ceiling as A002984 is to floor, and as A033638 is to round. - Jonathan Vos Post, Oct 08 2011
a(n-2) gives the number of distinct graphs with n vertices and n regions. - Erik Hasse, Oct 18 2011
Construct the n-th row of Pascal's triangle (A007318) from the preceding row, starting with row 0 = 1. a(n) counts the total number of additions required to compute the triangle in this way up to row n, with the restrictions that copying a term does not count as an addition, and that all additions not required by the symmetry of Pascal's triangle are replaced by copying terms. - Douglas Latimer, Mar 05 2012
a(n) is the sum of the positive differences of the parts in the partitions of n+1 into exactly 2 parts. - Wesley Ivan Hurt, Jan 27 2013
a(n) is the maximum number of covering relations possible in an n-element graded poset. For n = 2m, this bound is achieved for the poset with two sets of m elements, with each point in the "upper" set covering each point in the "lower" set. For n = 2m+1, this bound is achieved by the poset with m nodes in an upper set covering each of m+1 nodes in a lower set. - Ben Branman, Mar 26 2013
a(n+2) is the number of (integer) partitions of n into 2 sorts of 1's and 1 sort of 2's. - Joerg Arndt, May 17 2013
Alternative statement of Oppermann's conjecture: For n>2, there is at least one prime between a(n) and a(n+1). - Ivan N. Ianakiev, May 23 2013. [This conjecture was mentioned in A220492, A222030. - Omar E. Pol, Oct 25 2013]
For any given prime number, p, there are an infinite number of a(n) divisible by p, with those a(n) occurring in evenly spaced clusters of three as a(n), a(n+1), a(n+2) for a given p. The divisibility of all a(n) by p and the result are given by the following equations, where m >= 1 is the cluster number for that p: a(2m*p)/p = p*m^2 - m; a(2m*p + 1)/p = p*m^2; a(2m*p + 2)/p = p*m^2 + m. The number of a(n) instances between clusters is 2*p - 3. - Richard R. Forberg, Jun 09 2013
Apart from the initial term this is the elliptic troublemaker sequence R_n(1,2) in the notation of Stange (see Table 1, p.16). For other elliptic troublemaker sequences R_n(a,b) see the cross references below. - Peter Bala, Aug 08 2013
a(n) is also the total number of twin hearts patterns (6c4c) packing into (n+1) X (n+1) coins, the coins left is A042948 and the voids left is A000982. See illustration in links. - Kival Ngaokrajang, Oct 24 2013
Partitions of 2n into parts of size 1, 2 or 4 where the largest part is 4, i.e., A073463(n,2). - Henry Bottomley, Oct 28 2013
a(n+1) is the minimum length of a sequence (of not necessarily distinct terms) that guarantees the existence of a (not necessarily consecutive) subsequence of length n in which like terms appear consecutively. This is also the minimum cardinality of an ordered set S that ensures that, given any partition of S, there will be a subset T of S so that the induced subpartition on T avoids the pattern ac/b, where a < b < c. - Eric Gottlieb, Mar 05 2014
Also the number of elements of the list 1..n+1 such that for any two elements {x,y} the integer (x+y)/2 lies in the range ]x,y[. - Robert G. Wilson v, May 22 2014
Number of lattice points (x,y) inside the region of the coordinate plane bounded by x <= n, 0 < y <= x/2. For a(11)=30 there are exactly 30 lattice points in the region below:
6| .
.| . |
5| .+__+
.| . | | |
4| .+__++__+
.| . | | | | |
3| .+__++__++__+
.| . | | | | | | |
2| .+__++__++__++__+
.| . | | | | | | | | |
1| .+__++__++__++__++__+
.|. | | | | | | | | | | |
0|.+__++__++__++__++__++_________
0 1 2 3 4 5 6 7 8 9 10 11 .. n
0 0 1 2 4 6 9 12 16 20 25 30 .. a(n) - Wesley Ivan Hurt, Oct 26 2014
a(n+1) is the greatest integer k for which there exists an n x n matrix M of nonnegative integers with every row and column summing to k, such that there do not exist n entries of M, all greater than 1, and no two of these entries in the same row or column. - Richard Stanley, Nov 19 2014
In a tiling of the triangular shape T_N with row length k for row k = 1, 2, ..., N >= 1 (or, alternatively row length N = 1-k for row k) with rectangular tiles, there can appear rectangles (i, j), N >= i >= j >= 1, of a(N+1) types (and their transposed shapes obtained by interchanging i and j). See the Feb 27 2004 comment above from Rick L. Shepherd. The motivation to look into this came from a proposal of Kival Ngaokrajang in A247139. - Wolfdieter Lang, Dec 09 2014
Every positive integer is a sum of at most four distinct quarter-squares; see A257018. - Clark Kimberling, Apr 15 2015
a(n+1) gives the maximal number of distinct elements of an n X n matrix which is symmetric (w.r.t. the main diagonal) and symmetric w.r.t. the main antidiagonal. Such matrices are called bisymmetric. See the Wikipedia link. - Wolfdieter Lang, Jul 07 2015
For 2^a(n+1), n >= 1, the number of binary bisymmetric n X n matrices, see A060656(n+1) and the comment and link by Dennis P. Walsh. - Wolfdieter Lang, Aug 16 2015
a(n) is the number of partitions of 2n+1 of length three with exactly two even entries (see below example). - John M. Campbell, Jan 29 2016
a(n) is the sum of the asymmetry degrees of all 01-avoiding binary words of length n. The asymmetry degree of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. a(6) = 9 because the 01-avoiding binary words of length 6 are 000000, 100000, 110000, 111000, 111100, 111110, and 111111, and the sum of their asymmetry degrees is 0 + 1 + 2 + 3 + 2 + 1 + 0 = 9. Equivalently, a(n) = Sum_{k>=0} k*A275437(n,k). - Emeric Deutsch, Aug 15 2016
a(n) is the number of ways to represent all the integers in the interval [3,n+1] as the sum of two distinct natural numbers. E.g., a(7)=12 as there are 12 different ways to represent all the numbers in the interval [3,8] as the sum of two distinct parts: 1+2=3, 1+3=4, 1+4=5, 1+5=6, 1+6=7, 1+7=8, 2+3=5, 2+4=6, 2+5=7, 2+6=8, 3+4=7, 3+5=8. - Anton Zakharov, Aug 24 2016
a(n+2) is the number of conjugacy classes of involutions (considering the identity as an involution) in the hyperoctahedral group C_2 wreath S_n. - Mark Wildon, Apr 22 2017
a(n+2) is the maximum number of pieces of a pizza that can be made with n cuts that are parallel or perpendicular to each other. - Anton Zakharov, May 11 2017
Also the matching number of the n X n black bishop graph. - Eric W. Weisstein, Jun 26 2017
The answer to a question posed by W. Mantel: a(n) is the maximum number of edges in an n-vertex triangle-free graph. Also solved by H. Gouwentak, J. Teixeira de Mattes, F. Schuh and W. A. Wythoff. - Charles R Greathouse IV, Feb 01 2018
Number of nonisomorphic outer planar graphs of order n >= 3, size n+2, and maximum degree 4. - Christian Barrientos and Sarah Minion, Feb 27 2018
Maximum area of a rectangle with perimeter 2n and sides of integer length. - André Engels, Jul 29 2018
Also the crossing number of the complete bipartite graph K_{3,n+1}. - Eric W. Weisstein, Sep 11 2018
a(n+2) is the number of distinct genotype frequency vectors possible for a sample of n diploid individuals at a biallelic genetic locus with a specified major allele. Such vectors are the lists of nonnegative genotype frequencies (n_AA, n_AB, n_BB) with n_AA + n_AB + n_BB = n and n_AA >= n_BB. - Noah A Rosenberg, Feb 05 2019
a(n+2) is the number of distinct real spectra (eigenvalues repeated according to their multiplicity) for an orthogonal n X n matrix. The case of an empty spectrum list is logically counted as one of those possibilities, when it exists. Thus a(n+2) is the number of distinct reduced forms (on the real field, in orthonormal basis) for elements in O(n). - Christian Devanz, Feb 13 2019
a(n) is the number of non-isomorphic asymmetric graphs that can be created by adding a single edge to a path on n+4 vertices. - Emma Farnsworth, Natalie Gomez, Herlandt Lino, and Darren Narayan, Jul 03 2019
a(n+1) is the number of integer triangles with largest side n. - James East, Oct 30 2019
a(n) is the number of nonempty subsets of {1,2,...,n} that contain exactly one odd and one even number. For example, for n=7, a(7)=12 and the 12 subsets are {1,2}, {1,4}, {1,6}, {2,3}, {2,5}, {2,7}, {3,4}, {3,6}, {4,5}, {4,7}, {5,6}, {6,7}. - Enrique Navarrete, Dec 16 2019
Aside from the first two terms, a(n) enumerates the number of distinct normal ordered terms in the expansion of the differential operator (x + d/dx)^m associated to the Hermite polynomials and the Heisenberg-Weyl algebra. It also enumerates the number of distinct monomials in the bivariate polynomials corresponding to the partial sums of the series for cos(x+y) and sin(x+y). Cf. A344678. - Tom Copeland, May 27 2021
a(n) is the maximal number of negative products a_i * a_j (1 <= i <= j <= n), where all a_i are real numbers. - Logan Pipes, Jul 08 2021
From Allan Bickle, Dec 20 2021: (Start)
a(n) is the maximum product of the chromatic numbers of a graph of order n-1 and its complement. The extremal graphs are characterized in the papers of Finck (1968) and Bickle (2023).
a(n) is the maximum product of the degeneracies of a graph of order n+1 and its complement. The extremal graphs are characterized in the paper of Bickle (2012). (End)
a(n) is the maximum number m such that m white rooks and m black rooks can coexist on an n-1 X n-1 chessboard without attacking each other. - Aaron Khan, Jul 13 2022
Partial sums of A004526. - Bernard Schott, Jan 06 2023
a(n) is the number of 231-avoiding odd Grassmannian permutations of size n. - Juan B. Gil, Mar 10 2023
a(n) is the number of integer tuples (x,y) satisfying n + x + y >= 0, 25*n + x - 11*y >=0, 25*n - 11*x + y >=0, n + x + y == 0 (mod 12) , 25*n + x - 11*y == 0 (mod 5), 25*n - 11*x + y == 0 (mod 5) . For n=2, the sole solution is (x,y) = (0,0) and so a(2) = 1. For n = 3, the a(3) = 2 solutions are (-3, 2) and (2, -3). - Jeffery Opoku, Feb 16 2024
Let us consider triangles whose vertices are the centers of three squares constructed on the sides of a right triangle. a(n) is the integer part of the area of these triangles, taken without repetitions and in ascending order. See the illustration in the links. - Nicolay Avilov, Aug 05 2024
For n>=2, a(n) is the indendence number of the 2-token graph F_2(P_n) of the path graph P_n on n vertices. (Alternatively, as noted by Peter Munn, F_2(P_n) is the nXn square lattice, or grid, graph diminished by a cut across the diagonal.) - Miquel A. Fiol, Oct 05 2024
For n >= 1, also the lower matching number of the n-triangular honeycomb rook graph. - Eric W. Weisstein, Dec 14 2024
a(n-1) is also the minimal number of edges that a graph of n vertices must have such that any 3 vertices share at least one edge. - Ruediger Jehn, May 20 2025
a(n) is the number of edges of the antiregular graph A_n. This is the unique connected graph with n vertices and degrees 1 to n-1 (floor(n/2) repeated). - Allan Bickle, Jun 15 2025

Examples

			a(3) = 2, floor(3/2)*ceiling(3/2) = 2.
[ n] a(n)
---------
[ 2] 1
[ 3] 2
[ 4] 1 + 3
[ 5] 2 + 4
[ 6] 1 + 3 + 5
[ 7] 2 + 4 + 6
[ 8] 1 + 3 + 5 + 7
[ 9] 2 + 4 + 6 + 8
From _Wolfdieter Lang_, Dec 09 2014: (Start)
Tiling of a triangular shape T_N, N >= 1 with rectangles:
N=5, n=6: a(6) = 9 because all the rectangles (i, j) (modulo transposition, i.e., interchange of i and j) which are of use are:
  (5, 1)                ;  (1, 1)
  (4, 2), (4, 1)        ;  (2, 2), (2, 1)
                        ;  (3, 3), (3, 2), (3, 1)
That is (1+1) + (2+2) + 3 = 9 = a(6). Partial sums of 1, 1, 2, 2, 3, ... (A004526). (End)
Bisymmetric matrices B: 2 X 2, a(3) = 2 from B[1,1] and B[1,2]. 3 X 3, a(4) = 4 from B[1,1], B[1,2], B[1,3], and B[2,2]. - _Wolfdieter Lang_, Jul 07 2015
From _John M. Campbell_, Jan 29 2016: (Start)
Letting n=5, there are a(n)=a(5)=6 partitions of 2n+1=11 of length three with exactly two even entries:
(8,2,1) |- 2n+1
(7,2,2) |- 2n+1
(6,4,1) |- 2n+1
(6,3,2) |- 2n+1
(5,4,2) |- 2n+1
(4,4,3) |- 2n+1
(End)
From _Aaron Khan_, Jul 13 2022: (Start)
Examples of the sequence when used for rooks on a chessboard:
.
A solution illustrating a(5)=4:
  +---------+
  | B B . . |
  | B B . . |
  | . . W W |
  | . . W W |
  +---------+
.
A solution illustrating a(6)=6:
  +-----------+
  | B B . . . |
  | B B . . . |
  | B B . . . |
  | . . W W W |
  | . . W W W |
  +-----------+
(End)
		

References

  • Sergei Abramovich, Combinatorics of the Triangle Inequality: From Straws to Experimental Mathematics for Teachers, Spreadsheets in Education (eJSiE), Vol. 9, Issue 1, Article 1, 2016. See Fig. 3.
  • G. L. Alexanderson et al., The William Powell Putnam Mathematical Competition - Problems and Solutions: 1965-1984, M.A.A., 1985; see Problem A-1 of 27th Competition.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 73, problem 25.
  • Michael Doob, The Canadian Mathematical Olympiad -- L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society -- Société Mathématique du Canada, Problème 9, 1970, pp 22-23, 1993.
  • H. J. Finck, On the chromatic numbers of a graph and its complement. Theory of Graphs (Proc. Colloq., Tihany, 1966) Academic Press, New York (1968), 99-113.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 99.
  • D. E. Knuth, The art of programming, Vol. 1, 3rd Edition, Addison-Wesley, 1997, Ex. 36 of section 1.2.4.
  • J. Nelder, Critical sets in Latin squares, CSIRO Division of Math. and Stats. Newsletter, Vol. 38 (1977), p. 4.
  • 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

A087811 is another version of this sequence.
Differences of A002623. Complement of A049068.
a(n) = A014616(n-2) + 2 = A033638(n) - 1 = A078126(n) + 1. Cf. A055802, A055803.
Antidiagonal sums of array A003983.
Cf. A033436 - A033444. - Reinhard Zumkeller, Nov 30 2009
Elliptic troublemaker sequences: A000212 (= R_n(1,3) = R_n(2,3)), A007590 (= R_n(2,4)), A030511 (= R_n(2,6) = R_n(4,6)), A033436 (= R_n(1,4) = R_n(3,4)), A033437 (= R_n(1,5) = R_n(4,5)), A033438 (= R_n(1,6) = R_n(5,6)), A033439 (= R_n(1,7) = R_n(6,7)), A184535 (= R_n(2,5) = R_n(3,5)).
Cf. A077043, A060656 (2^a(n)), A344678.
Cf. A250000 (queens on a chessboard), A176222 (kings on a chessboard), A355509 (knights on a chessboard).
Maximal product of k positive integers with sum n, for k = 2..10: this sequence (k=2), A006501 (k=3), A008233 (k=4), A008382 (k=5), A008881 (k=6), A009641 (k=7), A009694 (k=8), A009714 (k=9), A354600 (k=10).

Programs

  • GAP
    # using the formula by Paul Barry
    A002620 := List([1..10^4], n-> (2*n^2 - 1 + (-1)^n)/8); # Muniru A Asiru, Feb 01 2018
    
  • Haskell
    a002620 = (`div` 4) . (^ 2) -- Reinhard Zumkeller, Feb 24 2012
    
  • Magma
    [ Floor(n/2)*Ceiling(n/2) : n in [0..40]];
    
  • Maple
    A002620 := n->floor(n^2/4); G002620 := series(x^2/((1-x)^2*(1-x^2)),x,60);
    with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=1)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m),m=0..57) ; # Zerinvary Lajos, Mar 09 2007
  • Mathematica
    Table[Ceiling[n/2] Floor[n/2], {n, 0, 56}] (* Robert G. Wilson v, Jun 18 2005 *)
    LinearRecurrence[{2, 0, -2, 1}, {0, 0, 1, 2}, 60] (* Harvey P. Dale, Oct 05 2012 *)
    Table[Floor[n^2/4], {n, 0, 20}] (* Eric W. Weisstein, Sep 11 2018 *)
    Floor[Range[0, 20]^2/4] (* Eric W. Weisstein, Sep 11 2018 *)
    CoefficientList[Series[-(x^2/((-1 + x)^3 (1 + x))), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 11 2018 *)
    Table[Floor[n^2/2]/2, {n, 0, 56}] (* Clark Kimberling, Dec 05 2021 *)
  • Maxima
    makelist(floor(n^2/4),n,0,50); /* Martin Ettl, Oct 17 2012 */
    
  • PARI
    a(n)=n^2\4
    
  • PARI
    (t(n)=n*(n+1)/2);for(i=1,50,print1(",",(-1)^i*sum(k=1,i,(-1)^k*t(k))))
    
  • PARI
    a(n)=n^2>>2 \\ Charles R Greathouse IV, Nov 11 2009
    
  • PARI
    x='x+O('x^100); concat([0, 0], Vec(x^2/((1-x)^2*(1-x^2)))) \\ Altug Alkan, Oct 15 2015
    
  • Python
    def A002620(n): return (n**2)>>2 # Chai Wah Wu, Jul 07 2022
  • Sage
    def A002620():
         x, y = 0, 1
         yield x
         while true:
             yield x
             x, y = x + y, x//y + 1
    a = A002620(); print([next(a) for i in range(58)]) # Peter Luschny, Dec 17 2015
    

Formula

a(n) = (2*n^2-1+(-1)^n)/8. - Paul Barry, May 27 2003
G.f.: x^2/((1-x)^2*(1-x^2)) = x^2 / ( (1+x)*(1-x)^3 ). - Simon Plouffe in his 1992 dissertation, leading zeros dropped
E.g.f.: exp(x)*(2*x^2+2*x-1)/8 + exp(-x)/8.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Jaume Oliver Lafont, Dec 05 2008
a(-n) = a(n) for all n in Z.
a(n) = a(n-1) + floor(n/2), n > 0. Partial sums of A004526. - Adam Kertesz, Sep 20 2000
a(n) = a(n-1) + a(n-2) - a(n-3) + 1 [with a(-1) = a(0) = a(1) = 0], a(2k) = k^2, a(2k-1) = k(k-1). - Henry Bottomley, Mar 08 2000
0*0, 0*1, 1*1, 1*2, 2*2, 2*3, 3*3, 3*4, ... with an obvious pattern.
a(n) = Sum_{k=1..n} floor(k/2). - Yong Kong (ykong(AT)curagen.com), Mar 10 2001
a(n) = n*floor((n-1)/2) - floor((n-1)/2)*(floor((n-1)/2)+ 1); a(n) = a(n-2) + n-2 with a(1) = 0, a(2) = 0. - Santi Spadaro, Jul 13 2001
Also: a(n) = binomial(n, 2) - a(n-1) = A000217(n-1) - a(n-1) with a(0) = 0. - Labos Elemer, Apr 26 2003
a(n) = Sum_{k=0..n} (-1)^(n-k)*C(k, 2). - Paul Barry, Jul 01 2003
a(n) = (-1)^n * partial sum of alternating triangular numbers. - Jon Perry, Dec 30 2003
a(n) = A024206(n+1) - n. - Philippe Deléham, Feb 27 2004
a(n) = a(n-2) + n - 1, n > 1. - Paul Barry, Jul 14 2004
a(n+1) = Sum_{i=0..n} min(i, n-i). - Marc LeBrun, Feb 15 2005
a(n+1) = Sum_{k = 0..floor((n-1)/2)} n-2k; a(n+1) = Sum_{k=0..n} k*(1-(-1)^(n+k-1))/2. - Paul Barry, Apr 16 2005
a(n) = A108561(n+1,n-2) for n > 2. - Reinhard Zumkeller, Jun 10 2005
1 + 1/(1 + 2/(1 + 4/(1 + 6/(1 + 9/(1 + 12/(1 + 16/(1 + ...))))))) = 6/(Pi^2 - 6) = 1.550546096730... - Philippe Deléham, Jun 20 2005
a(n) = Sum_{k=0..n} Min_{k, n-k}, sums of rows of the triangle in A004197. - Reinhard Zumkeller, Jul 27 2005
For n > 2 a(n) = a(n-1) + ceiling(sqrt(a(n-1))). - Jonathan Vos Post, Jan 19 2006
Sequence starting (2, 2, 4, 6, 9, ...) = A128174 (as an infinite lower triangular matrix) * vector [1, 2, 3, ...]; where A128174 = (1; 0,1; 1,0,1; 0,1,0,1; ...). - Gary W. Adamson, Jul 27 2007
a(n) = Sum_{i=k..n} P(i, k) where P(i, k) is the number of partitions of i into k parts. - Thomas Wieder, Sep 01 2007
a(n) = sum of row (n-2) of triangle A115514. - Gary W. Adamson, Oct 25 2007
For n > 1: gcd(a(n+1), a(n)) = a(n+1) - a(n). - Reinhard Zumkeller, Apr 06 2008
a(n+3) = a(n) + A000027(n) + A008619(n+1) = a(n) + A001651(n+1) with a(1) = 0, a(2) = 0, a(3) = 1. - Yosu Yurramendi, Aug 10 2008
a(2n) = A000290(n). a(2n+1) = A002378(n). - Gary W. Adamson, Nov 29 2008
a(n+1) = a(n) + A110654(n). - Reinhard Zumkeller, Aug 06 2009
a(n) = Sum_{k=0..n} (k mod 2)*(n-k); Cf. A000035, A001477. - Reinhard Zumkeller, Nov 05 2009
a(n-1) = (n*n - 2*n + n mod 2)/4. - Ctibor O. Zizka, Nov 23 2009
a(n) = round((2*n^2-1)/8) = round(n^2/4) = ceiling((n^2-1)/4). - Mircea Merca, Nov 29 2010
n*a(n+2) = 2*a(n+1) + (n+2)*a(n). Holonomic Ansatz with smallest order of recurrence. - Thotsaporn Thanatipanonda, Dec 12 2010
a(n+1) = (n*(2+n) + n mod 2)/4. - Fred Daniel Kline, Sep 11 2011
a(n) = A199332(n, floor((n+1)/2)). - Reinhard Zumkeller, Nov 23 2011
a(n) = floor(b(n)) with b(n) = b(n-1) + n/(1+e^(1/n)) and b(0)= 0. - Richard R. Forberg, Jun 08 2013
a(n) = Sum_{i=1..floor((n+1)/2)} (n+1)-2i. - Wesley Ivan Hurt, Jun 09 2013
a(n) = floor((n+2)/2 - 1)*(floor((n+2)/2)-1 + (n+2) mod 2). - Wesley Ivan Hurt, Jun 09 2013
Sum_{n>=2} 1/a(n) = 1 + zeta(2) = 1+A013661. - Enrique Pérez Herrero, Jun 30 2013
Empirical: a(n-1) = floor(n/(e^(4/n)-1)). - Richard R. Forberg, Jul 24 2013
a(n) = A007590(n)/2. - Wesley Ivan Hurt, Mar 08 2014
A237347(a(n)) = 3; A235711(n) = A003415(a(n)). - Reinhard Zumkeller, Mar 18 2014
A240025(a(n)) = 1. - Reinhard Zumkeller, Jul 05 2014
0 = a(n)*a(n+2) + a(n+1)*(-2*a(n+2) + a(n+3)) for all integers n. - Michael Somos, Nov 22 2014
a(n) = Sum_{j=1..n} Sum_{i=1..n} ceiling((i+j-n-1)/2). - Wesley Ivan Hurt, Mar 12 2015
a(4n+1) = A002943(n) for all n>=0. - M. F. Hasler, Oct 11 2015
a(n+2)-a(n-2) = A004275(n+1). - Anton Zakharov, May 11 2017
a(n) = floor(n/2)*floor((n+1)/2). - Bruno Berselli, Jun 08 2017
a(n) = a(n-3) + floor(3*n/2) - 2. - Yuchun Ji, Aug 14 2020
a(n)+a(n+1) = A000217(n). - R. J. Mathar, Mar 13 2021
a(n) = A004247(n,floor(n/2)). - Logan Pipes, Jul 08 2021
a(n) = floor(n^2/2)/2. - Clark Kimberling, Dec 05 2021
Sum_{n>=2} (-1)^n/a(n) = Pi^2/6 - 1. - Amiram Eldar, Mar 10 2022

A003991 Multiplication table read by antidiagonals: T(i,j) = i*j, i>=1, j>=1.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 4, 6, 6, 4, 5, 8, 9, 8, 5, 6, 10, 12, 12, 10, 6, 7, 12, 15, 16, 15, 12, 7, 8, 14, 18, 20, 20, 18, 14, 8, 9, 16, 21, 24, 25, 24, 21, 16, 9, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 11, 20, 27, 32, 35, 36, 35, 32, 27, 20, 11, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30, 22, 12
Offset: 1

Views

Author

Keywords

Comments

Or, triangle X(n,m) = T(n-m+1,m) read by rows, in which row n gives the numbers n*1, (n-1)*2, (n-2)*3, ..., 2*(n-1), 1*n.
Radius of incircle of Pythagorean triangle with sides a=(n+1)^2-m^2, b=2*(n+1)*m and c=(n+1)^2+m^2. - Floor van Lamoen, Aug 16 2001
A permutation of A061017. - Matthew Vandermast, Feb 28 2003
In the proof of countability of rational numbers they are arranged in a square array. a(n) = p*q where p/q is the corresponding rational number as read from the array. - Amarnath Murthy, May 29 2003
Permanent of upper right n X n corner is A000442. - Marc LeBrun, Dec 11 2003
Row 12 gives total number of partridges, turtle doves, ... and drummers drumming that you have received at the end of the Twelve Days of Christmas song. - Alonso del Arte, Jun 17 2005
Consider a particle with spin S (a half-integer) and 2S+1 quantum states |m>, m = -S,-S+1,...,S-1,S. Then the matrix element = sqrt((S+m+1)(S-m)) of the spin-raising operator is the square-root of the triangular (tabl) element T(r,o) of this sequence in row r = 2S, and at offset o=2(S+m). T(r,o) is also the intensity || of the transition between the states |m> and |m+1>. For example, the five transitions between the 6 states of a spin S=5/2 particle have relative intensities 5,8,9,8,5. The total intensity of all spin 5/2 transitions (relative to spin 1/2) is 35, which is the tetrahedral number A000292(5). - Stanislav Sykora, May 26 2012
Sum_{k=0..2n-2} (-1)^k*a(A000124(2n-2)+k) = n. See A098359. - Charlie Marion, Apr 22 2013
T(n, k) is also the (k-1)-superdiagonal sum of an n X n Toeplitz matrix M(n) whose first row consists of successive positive integer numbers 1, ..., n. - Stefano Spezia, Jul 12 2019
From Eric Lengyel, Jun 28 2023: (Start)
X(n, m+1) is the number of degrees of freedom that an m-dimensional flat geometry (point, line, plane, etc.) has when embedded in an n-dimensional Euclidean space.
X(n+1, m+1) is the number of degrees of freedom that an m-ball has when embedded in an n-dimensional Euclidean space. (End)
T(n, k) is also the average number of steps it takes a person to fall off a board of length n+k, if the person starts a random walk at k. - Ruediger Jehn, May 12 2025

Examples

			The array T starts in row n=1 with columns m>=1 as:
   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
   2   4   6   8  10  12  14  16  18  20  22  24  26  28  30
   3   6   9  12  15  18  21  24  27  30  33  36  39  42  45
   4   8  12  16  20  24  28  32  36  40  44  48  52  56  60
   5  10  15  20  25  30  35  40  45  50  55  60  65  70  75
   6  12  18  24  30  36  42  48  54  60  66  72  78  84  90
   7  14  21  28  35  42  49  56  63  70  77  84  91  98 105
   8  16  24  32  40  48  56  64  72  80  88  96 104 112 120
   9  18  27  36  45  54  63  72  81  90  99 108 117 126 135
  10  20  30  40  50  60  70  80  90 100 110 120 130 140 150
The triangle X(n, m) begins
   n\m  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
   1:   1
   2:   2  2
   3:   3  4  3
   4:   4  6  6  4
   5:   5  8  9  8  5
   6:   6 10 12 12 10  6
   7:   7 12 15 16 15 12  7
   8:   8 14 18 20 20 18 14  8
   9:   9 16 21 24 25 24 21 16  9
  10:  10 18 24 28 30 30 28 24 18 10
  11:  11 20 27 32 35 36 35 32 27 20 11
  12:  12 22 30 36 40 42 42 40 36 30 22 12
  13:  13 24 33 40 45 48 49 48 45 40 33 24 13
  14:  14 26 36 44 50 54 56 56 54 50 44 36 26 14
  15:  15 28 39 48 55 60 63 64 63 60 55 48 39 28 15
  ... Formatted by _Wolfdieter Lang_, Dec 02 2014
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 46.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 5-6.

Crossrefs

Main diagonal gives squares A000290. Antidiagonal sums are tetrahedral numbers A000292. See A004247 for another version.

Programs

  • Magma
    /* As triangle */ [[k*(n-k+1): k in [1..n]]: n in [1..15]]; // Vincenzo Librandi, Jul 12 2019
  • Maple
    seq(seq(i*(n-i),i=1..n-1),n=2..10); # Robert Israel, Dec 14 2015
  • Mathematica
    Table[(x + 1 - y) y, {x, 13}, {y, x}] // Flatten (* Robert G. Wilson v, Oct 06 2007 *)
    f[n_] := Table[SeriesCoefficient[E^(x + y) (1+ x - y +x*y-y^2), {x, 0, i}, {y, 0, j}]*i!*j!, {i, n, n}, {j, 0, n}]; Flatten[Array[f, 11,0]] (* Stefano Spezia, Jul 12 2019 *)
  • PARI
    A003991(n,k) = if(k<1 || n<1,0,k*n)
    

Formula

Rectangular array: T(n, m) = n*m, n>=1, m>= 1.
Triangle X(n, m) = T(n-m+1, m) = (n-m+1)*m.
Sum_{i=1..n} Sum_{j=1..n} a(n) = A000537(n) [Sum of first n cubes; or n-th triangular number squared.] Determinant of all n X n contiguous subarrays of A003991 is 0. - Gerald McGarvey, Sep 26 2004
G.f. as rectangular array: x*y/((1 - x)^2*(1 - y)^2).
a(n) = i*j, where i=floor((1+sqrt(8n-7))/2), j=n-i*(i-1)/2. - Hieronymus Fischer, Aug 08 2007
As an infinite lower triangular matrix equals A000012 * A002260; where A000012 = (1; 1,1; 1,1,1; ...) and A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Oct 23 2007
As a linear array, the sequence is a(n) = A002260(n)*A004736(n) or a(n) = ((t*t+3*t+4)/2-n)*(n-(t*(t+1)/2)), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 17 2012
G.f. as linear array: (x - 3*x^2 + Sum_{k >= 0} ((k+2-x-(k+1)*x^2)*x^((k^2+3*k+4)/2)))/(1-x)^3. - Robert Israel, Dec 14 2015
E.g.f. as triangle: exp(x+y)*(1 + x - y + x*y - y^2). - Stefano Spezia, Jul 12 2019
a(n) = (1/2)*t + (n - 1/4)*t^2 - (1/4)*t^4 - n^2 + n, where t = floor(sqrt(2*n) + 1/2). - Ridouane Oudra, Nov 21 2020
a(n) = A003989(n) * A003990(n) = A059895(n) * A059896(n) = A059895(n)^2 * A059897(n). - Antti Karttunen, Dec 13 2021
T(n,k) = A002620(n+k) - A002620(n-k). - Michel Marcus, Jan 06 2023
T(n,k) = number of sums |x-y|+|y-z| = k, where x,y,z are in {1,2,...,n} and x < y < z. - Clark Kimberling, Jan 22 2024
E.g.f. as rectangular array: x*y*exp(x+y). - Stefano Spezia, Jun 27 2025

Extensions

More terms from Michael Somos

A077028 The rascal triangle, read by rows: T(n,k) (n >= 0, 0 <= k <= n) = k(n-k) + 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 4, 1, 1, 5, 7, 7, 5, 1, 1, 6, 9, 10, 9, 6, 1, 1, 7, 11, 13, 13, 11, 7, 1, 1, 8, 13, 16, 17, 16, 13, 8, 1, 1, 9, 15, 19, 21, 21, 19, 15, 9, 1, 1, 10, 17, 22, 25, 26, 25, 22, 17, 10, 1, 1, 11, 19, 25, 29, 31, 31, 29, 25, 19, 11, 1, 1, 12, 21, 28, 33, 36, 37, 36, 33, 28, 21, 12, 1
Offset: 0

Views

Author

Clark Kimberling, Oct 19 2002

Keywords

Comments

Pascal's triangle is formed using the rule South = West + East, whereas the rascal triangle uses the rule South = (West*East+1)/North. [Anggoro et al.]
The n-th diagonal is congruent to 1 mod n-1.
Row sums are the cake numbers, A000125. Alternating sum of row n is 0 if n even and (3-n)/2 if n odd. Rows are symmetric, beginning and ending with 1. The number of occurrences of k in this triangle is the number of divisors of k-1, given by A000005.
The triangle can be generated by numbers of the form k*(n-k) + 1 for k = 0 to n. Conjecture: except for n = 0,1 and 6 every row contains a prime. - Amarnath Murthy, Jul 15 2005
Above conjecture needs more exceptions, rows 30 and 54 do not contain primes. - Alois P. Heinz, Aug 31 2017
From Moshe Shmuel Newman, Apr 06 2008: (Start)
Consider the semigroup of words in x,y,q subject to the relationships: yx = xyq, qx = xq, qy = yq.
Now take words of length n in x and y, with exactly k y's. If there had been no relationships, the number of different words of this type would be n choose k, sequence A007318. Thanks to the relationships, the number of words of this type is the k-th entry in the n-th row of this sequence (read as a triangle, with the first row indexed by zero and likewise the first entry in each row.)
For example: with three letters and one y, we have three possibilities: xxy, xyx = xxyq, yxx = xxyqq. No two of them are equal, so this entry is still 3, as in Pascal's triangle.
With four letters, two y's, we have the first reduction: xyyx = yxxy = xxyyqq and this is the only reduction for 4 letters. So the middle entry of the fourth row is 5 instead of 6, as in the Pascal triangle. (End)
Main diagonals of this triangle sum to polygonal numbers. See A057145. - Raphie Frank, Oct 30 2012
T(n,k) gives the number of distinct sums of k elements in {1,2,...,n}, e.g., T(5,4) = the number of distinct sums of 4 elements in {1,2,3,4,5}, which is (5+4+3+2) - (4+3+2+1) + 1 = 5. - Derek Orr, Nov 26 2014
Conjecture: excluding the starting and ending 1's in each row, those that contain only prime numbers are n = 2, 3, 5, 7, 13, and 17. Tested up to row 10^9. - Rogério Serôdio, Sep 20 2017
The rascal triangle also uses the rule South = (West+East+1)-North. [Abstracts of AMS, Winter 2019, p. 526, 1145-VS-280, refers to Julian Fleron] - Michael Somos, Jan 12 2019
As a square array read by antidiagonals, selecting terms that give a remainder of 1 when divided by a prime gives evenly sized squares. For example, when each term is divided by 2, showing the remainder looks like:
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1 - Nathaniel J. Strout, Jan 01 2020
T(n,k) is the number of binary words of length n which contain exactly k 1s and have at most 1 ascent. T(n,k) is also the number of ascent sequences avoiding 001 and 210 with length n+1 and exactly k ascents. - Amelia Gibbs, May 21 2024
T(n,k) represents the first and foundational instance R1 of a new family of Pascal-like triangles called Iterated Rascal triangles; A374378 is triangle R2; A374452 is triangle R3. - Kolosov Petro, Sep 28 2024

Examples

			Third diagonal (1,3,5,7,...) consists of the positive integers congruent to 1 mod 2.
The triangle T(n, k) begins:
  n\k  0  1  2  3  4  5  6  7  8  9 10 ...
  0:   1
  1:   1  1
  2:   1  2  1
  3:   1  3  3  1
  4:   1  4  5  4  1
  5:   1  5  7  7  5  1
  6:   1  6  9 10  9  6  1
  7:   1  7 11 13 13 11  7  1
  8:   1  8 13 16 17 16 13  8  1
  9:   1  9 15 19 21 21 19 15  9  1
 10:   1 10 17 22 25 26 25 22 17 10  1
 ... reformatted. - _Wolfdieter Lang_, Dec 19 2017
As a square array read by antidiagonals, the first rows are:
  1,  1,  1,  1,  1,  1, ...
  1,  2,  3,  4,  5,  6, ...
  1,  3,  5,  7,  9, 11, ...
  1,  4,  7, 10, 13, 16, ...
  1,  5,  9, 13, 17, 21, ...
		

Crossrefs

The maximum value for each antidiagonal is given by sequence A033638.
Equals A004247(n) + 1.

Programs

  • Maple
    A077028 := proc(n,k)
       if n <0 or k<0 or k > n then
           0;
       else
           k*(n-k)+1 ;
       end if;
    end proc: # R. J. Mathar, Jul 28 2016
  • Mathematica
    t[n_, k_] := k (n - k) + 1; t[0, 0] = 1; Table[ t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Robert G. Wilson v, Jul 06 2012 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, k * (n - k) + 1)}; /* Michael Somos, Mar 20 2011 */

Formula

As a square array read by antidiagonals, a(n, k) = 1 + n*k. a(n, k) = a(n-1, k) + k. Row n has g.f. (1+(n-1)x)/(1-x)^2, n >= 0. - Paul Barry, Feb 22 2003
Still thinking of square arrays. Let f:N->Z and g:N->Z be given and I an integer, then define a(n, k) = I + f(n)*g(k). Then a(n, k)*a(n-1, k-1) = a(n-1, k)*a(n, k-1) + I*(f(n) - f(n-1))*(g(k) - g(k-1)) for suitable n and k. S= (E*W + 1)/N. arises with I = 1, and f = g = id. - Terry Lindgren, Apr 10 2011
Using the above: Having just read J. Fleron's nice article in Discovering the Art of Mathematics on the rascal triangle, it is neat to note and straightforward to show that when I = 1, a(n, k) + a(n-1, k-1) = a(n-1, k) + a(n, k-1) + (f(n) - f(n-1))*(g(k) - g(k-1)), so with I = 1, and f = g = id, we have S+N = E+W + 1, as his students discovered. - Terry Lindgren, Nov 28 2016
T(n, k) = A128139(n-1, k-1). - Gary W. Adamson, Jul 02 2012
O.g.f. (1 - x*(1 + t) + 2*t*x^2)/((1 - x)^2*(1 - t*x)^2) = 1 + (1 + t)*x + (1 + 2*t + t^2)*x^2 + .... Cf. A105851. - Peter Bala, Jul 26 2015
T(n, k) = 0 if n < k, T(n, 0) = 1, T(n,n) = 1, for n >= 0, and T(n, k) = (T(n-1, k-1)*T(n-1, k) + 1)/(T(n-2, k-1)) for 0 < k < n. See the first comment referring to the triangle with its apex in the middle. - Wolfdieter Lang, Dec 19 2017
E.g.f. as square array: exp(x+y)*(1 + x*y). - Stefano Spezia, Aug 10 2025

Extensions

Better definition based on Murthy's comment of Jul 15 2005 and the Anggoro et al. paper. - N. J. A. Sloane, Mar 05 2011
Showing 1-10 of 58 results. Next