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 11 results. Next

A007590 a(n) = floor(n^2/2).

Original entry on oeis.org

0, 0, 2, 4, 8, 12, 18, 24, 32, 40, 50, 60, 72, 84, 98, 112, 128, 144, 162, 180, 200, 220, 242, 264, 288, 312, 338, 364, 392, 420, 450, 480, 512, 544, 578, 612, 648, 684, 722, 760, 800, 840, 882, 924, 968, 1012, 1058, 1104, 1152, 1200, 1250, 1300, 1352, 1404
Offset: 0

Views

Author

Keywords

Comments

Arithmetic mean of a pair of successive triangular numbers. - Amarnath Murthy, Jul 24 2005
Maximum sum of absolute differences of cyclically adjacent elements in a permutation of (1..n). For example, with n = 9, permutation (1,9,2,8,3,7,4,6,5) has adjacent differences (8,7,6,5,4,3,2,1,4) with maximal sum a(9) = 40. - Joshua Zucker, Dec 15 2005
a(n) = maximum number of non-overlapping 1 X 2 rectangles that can be packed into an n X n square. Rectangles can only be placed parallel to the sides of the square. Verified with Lobato's tool, see links. - Dmitry Kamenetsky, Aug 03 2009 [This is easily provable - David W. Wilson, Jan 25 2014]
Number of strictly increasing arrangements of 3 nonzero numbers in -(n+1)..(n+1) with sum zero. For example, a(2) = 2 has two solutions: (-3, 1, 2) and (-2, -1, 3) each add to zero. - Michael Somos, Apr 11 2011
For n >= 4 is a(n) the minimal value v such that v = Sum_{i in S1} i = Product_{j in S2} j with disjoint union of S1, S2 = {1, 2, ..., n+1}. Example: a(4) = 8 = 3+5 = 1*2*4. - Claudio Meller, May 27 2012
Sum_{n > 1} 1/a(n) = (zeta(2) + 1)/2. - Enrique Pérez Herrero, Jun 19 2013
Apart from the initial term this is the elliptic troublemaker sequence R_n(2,4) 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 12 2013
Maximum sum of displacements of elements in a permutation of (1..n). For example, with n = 9, permutation (5,6,7,8,9,1,2,3,4) has displacements (4,4,4,4,4,5,5,5,5) with maximal sum a(9) = 40. - David W. Wilson, Jan 25 2014
A245575(a(n)) mod 2 = 1, or for n > 0, where odd terms occur in A245575. - Reinhard Zumkeller, Aug 05 2014
Also the matching number of the n X n king, rook, and rook complement graphs. - Eric W. Weisstein, Jun 20 and Sep 14 2017
For n > 1, also the vertex count of the n X n white bishop graph. - Eric W. Weisstein, Jun 27 2017
This is also the number of distinct ways n^2 can be represented as the sum of two positive integers. - William Boyles, Jan 15 2018
Also the crossing number of the complete bipartite graph K_{4,n+1}. - Eric W. Weisstein, Sep 11 2018
The sequence can be obtained from A033429 by deleting the last digit of each term. - Bruno Berselli, Sep 11 2019
Starting at n=2, the number of facets of the n-dimensional Kunz cone C_(n+1). - Emily O'Sullivan, Jul 08 2023

Examples

			a(3) = 4 because 3^2/2 = 9/2 = 4.5 and floor(4.5) = 4.
a(4) = 8 because 4^2/2 = 16/2 = 8.
a(5) = 12 because 5^2/2 = 25/2 = 12.5 and floor(12.5) = 12.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column 3 of triangle A094953.
For n > 2: a(n) = sum of (n-1)-th row in triangle A101037.
A080476 is essentially the same sequence.
Cf. A000982.
Elliptic troublemaker sequences: A000212 (= R_n(1,3) = R_n(2,3)), A002620 (= R_n(1,2)), 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. A182834 (complement), A245575.
First differences: A052928(n+1), is first differences of A212964; partial sums: A212964(n+1), is partial sums of A052928. - Guenther Schrack, Dec 10 2017
Cf. A033429 (5*n^2).

Programs

  • Haskell
    a007550 = flip div 2 . (^ 2)  -- Reinhard Zumkeller, Aug 05 2014
    
  • Haskell
    a007590 = 0 : 0 : 0 : [ a1 + a2 - a3 + 2 | (a1, a2, a3) <- zip3 (tail (tail a007590)) (tail a007590) a007590 ] -- Luc Duponcheel, Sep 30 2020
    
  • Magma
    [Floor(n^2/2): n in [0..53]]; // Bruno Berselli, Mar 28 2011
    
  • Magma
    [Binomial(n,2)+Floor(n/2): n in [0..60]]; // Bruno Berselli, Jun 08 2017
    
  • Maple
    A007590:=n->floor(n^2/2); seq(A007590(k), k=0..100); # Wesley Ivan Hurt, Oct 29 2013
  • Mathematica
    Floor[Range[0, 53]^2/2] (* Alonso del Arte, Aug 07 2013 *)
    Table[Binomial[n, 2] + Floor[n/2], {n, 0, 60}] (* Bruno Berselli, Jun 08 2017 *)
    LinearRecurrence[{2, 0, -2, 1}, {0, 2, 4, 8}, 20] (* Eric W. Weisstein, Sep 14 2017 *)
    CoefficientList[Series[-2 x/((-1 + x)^3 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 14 2017 *)
    Table[Floor[n^2/2], {n, 0, 20}] (* Eric W. Weisstein, Sep 11 2018 *)
  • PARI
    {a(n) = n^2 \ 2}
    
  • PARI
    {a(n) = local(v, c, m); m = n+1; forvec( v = vector( 3, i, [-m, m]), if( 0==prod( k=1, 3, v[k]), next); if( 0==sum( k=1, 3, v[k]), c++), 2); c} /* Michael Somos, Apr 11 2011 */
    
  • PARI
    first(n) = Vec(2*x^2/((1+x)*(1-x)^3) + O(x^n), -n); \\ Iain Fox, Dec 11 2017
    
  • Python
    def A007590(n): return n**2//2 # Chai Wah Wu, Jun 07 2022

Formula

a(n) = a(n-1) + a(n-2) - a(n-3) + 2 = 2*A002620(n) = A000217(n+1) + A004526(n). - Henry Bottomley, Mar 08 2000
a(n+1) = Sum_{k=1..n} (k + (k mod 2)). Therefore a(n) = Sum_{k=1..n} 2*floor(k/2). - William A. Tedeschi, Mar 19 2008
From R. J. Mathar, Nov 22 2008: (Start)
G.f.: 2*x^2/((1+x)*(1-x)^3).
a(n+1) - a(n) = A052928(n+1). (End)
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - R. H. Hardin, Mar 28 2011
a(n) = (2*n^2 + (-1)^n - 1)/4. - Bruno Berselli, Mar 28 2011
a(n) = ceiling((n^2-1)/2) = binomial(n+1, 2) - ceiling(n/2). - Wesley Ivan Hurt, Mar 08 2014, Jun 14 2013
a(n+1) = A014105(n) - A032528(n). - Richard R. Forberg, Aug 07 2013
a(n) = binomial(n,2) + floor(n/2). - Bruno Berselli, Jun 08 2017
a(n) = A099392(n+1) - 1. - Guenther Schrack, Dec 10 2017
E.g.f.: (x*(x + 1)*cosh(x) + (x^2 + x - 1)*sinh(x))/2. - Stefano Spezia, May 06 2021
From Amiram Eldar, Mar 20 2022: (Start)
Sum_{n>=2} 1/a(n) = Pi^2/12 + 1/2.
Sum_{n>=2} (-1)^n/a(n) = Pi^2/12 - 1/2. (End)

Extensions

Edited by Charles R Greathouse IV, Apr 20 2010

A212959 Number of (w,x,y) such that w,x,y are all in {0,...,n} and |w-x| = |x-y|.

Original entry on oeis.org

1, 4, 11, 20, 33, 48, 67, 88, 113, 140, 171, 204, 241, 280, 323, 368, 417, 468, 523, 580, 641, 704, 771, 840, 913, 988, 1067, 1148, 1233, 1320, 1411, 1504, 1601, 1700, 1803, 1908, 2017, 2128, 2243, 2360, 2481, 2604, 2731, 2860, 2993, 3128, 3267
Offset: 0

Views

Author

Clark Kimberling, Jun 01 2012

Keywords

Comments

In the following guide to related sequences: M=max(x,y,z), m=min(x,y,z), and R=range=M-m. In some cases, it is an offset of the listed sequence which fits the conditions shown for w,x,y. Each sequence satisfies a linear recurrence relation, some of which are identified in the list by the following code (signature):
A: 2, 0, -2, 1, i.e., a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4);
B: 3, -2, -2, 3, -1;
C: 4, -6, 4, -1;
D: 1, 2, -2, -1, 1;
E: 2, 1, -4, 1, 2, -1;
F: 2, -1, 1, -2, 1;
G: 2, -1, 0, 1, -2, 1;
H: 2, -1, 2, -4, 2, -1, 2, -1;
I: 3, -3, 2, -3, 3, -1;
J: 4, -7, 8, -7, 4, -1.
...
A212959 ... |w-x|=|x-y| ...... recurrence type A
A212960 ... |w-x| != |x-y| ................... B
A212683 ... |w-x| < |x-y| .................... B
A212684 ... |w-x| >= |x-y| ................... B
A212963 ... see entry for definition ......... B
A212964 ... |w-x| < |x-y| < |y-w| ............ B
A006331 ... |w-x| < y ........................ C
A005900 ... |w-x| <= y ....................... C
A212965 ... w = R ............................ D
A212966 ... 2*w = R
A212967 ... w < R ............................ E
A212968 ... w >= R ........................... E
A077043 ... w = x > R ........................ A
A212969 ... w != x and x > R ................. E
A212970 ... w != x and x < R ................. E
A055998 ... w = x + y - 1
A011934 ... w < floor((x+y)/2) ............... B
A182260 ... w > floor((x+y)/2) ............... B
A055232 ... w <= floor((x+y)/2) .............. B
A011934 ... w >= floor((x+y)/2) .............. B
A212971 ... w < floor((x+y)/3) ............... B
A212972 ... w >= floor((x+y)/3) .............. B
A212973 ... w <= floor((x+y)/3) .............. B
A212974 ... w > floor((x+y)/3) ............... B
A212975 ... R is even ........................ E
A212976 ... R is odd ......................... E
A212978 ... R = 2*n - w - x
A212979 ... R = average{w,x,y}
A212980 ... w < x + y and x < y .............. B
A212981 ... w <= x+y and x < y ............... B
A212982 ... w < x + y and x <= y ............. B
A212983 ... w <= x + y and x <= y ............ B
A002623 ... w >= x + y and x <= y ............ B
A087811 ... w = 2*x + y ...................... A
A008805 ... w = 2*x + 2*y .................... D
A000982 ... 2*w = x + y ...................... F
A001318 ... 2*w = 2*x + y .................... F
A001840 ... w = 3*x + y
A212984 ... 3*w = x + y
A212985 ... 3*w = 3*x + y
A001399 ... w = 2*x + 3*y
A212986 ... 2*w = 3*x + y
A008810 ... 3*x = 2*x + y .................... F
A212987 ... 3*w = 2*x + 2*y
A001972 ... w = 4*x + y ...................... G
A212988 ... 4*w = x + y ...................... G
A212989 ... 4*w = 4*x + y
A008812 ... 5*w = 2*x + 3*y
A016061 ... n < w + x + y <= 2*n ............. C
A000292 ... w + x + y <=n .................... C
A000292 ... 2*n < w + x + y <= 3*n ........... C
A212977 ... n/2 < w + x + y <= n
A143785 ... w < R < x ........................ E
A005996 ... w < R <= x ....................... E
A128624 ... w <= R <= x ...................... E
A213041 ... R = 2*|w - x| .................... A
A213045 ... R < 2*|w - x| .................... B
A087035 ... R >= 2*|w - x| ................... B
A213388 ... R <= 2*|w - x| ................... B
A171218 ... M < 2*m .......................... B
A213389 ... R < 2|w - x| ..................... E
A213390 ... M >= 2*m ......................... E
A213391 ... 2*M < 3*m ........................ H
A213392 ... 2*M >= 3*m ....................... H
A213393 ... 2*M > 3*m ........................ H
A213391 ... 2*M <= 3*m ....................... H
A047838 ... w = |x + y - w| .................. A
A213396 ... 2*w < |x + y - w| ................ I
A213397 ... 2*w >= |x + y - w| ............... I
A213400 ... w < R < 2*w
A069894 ... min(|w-x|,|x-y|) = 1
A000384 ... max(|w-x|,|x-y|) = |w-y|
A213395 ... max(|w-x|,|x-y|) = w
A213398 ... min(|w-x|,|x-y|) = x ............. A
A213399 ... max(|w-x|,|x-y|) = x ............. D
A213479 ... max(|w-x|,|x-y|) = w+x+y ......... D
A213480 ... max(|w-x|,|x-y|) != w+x+y ........ E
A006918 ... |w-x| + |x-y| > w+x+y ............ E
A213481 ... |w-x| + |x-y| <= w+x+y ........... E
A213482 ... |w-x| + |x-y| < w+x+y ............ E
A213483 ... |w-x| + |x-y| >= w+x+y ........... E
A213484 ... |w-x|+|x-y|+|y-w| = w+x+y
A213485 ... |w-x|+|x-y|+|y-w| != w+x+y ....... J
A213486 ... |w-x|+|x-y|+|y-w| > w+x+y ........ J
A213487 ... |w-x|+|x-y|+|y-w| >= w+x+y ....... J
A213488 ... |w-x|+|x-y|+|y-w| < w+x+y ........ J
A213489 ... |w-x|+|x-y|+|y-w| <= w+x+y ....... J
A213490 ... w,x,y,|w-x|,|x-y| distinct
A213491 ... w,x,y,|w-x|,|x-y| not distinct
A213493 ... w,x,y,|w-x|,|x-y|,|w-y| distinct
A213495 ... w = min(|w-x|,|x-y|,|w-y|)
A213492 ... w != min(|w-x|,|x-y|,|w-y|)
A213496 ... x != max(|w-x|,|x-y|)
A213498 ... w != max(|w-x|,|x-y|,|w-y|)
A213497 ... w = min(|w-x|,|x-y|)
A213499 ... w != min(|w-x|,|x-y|)
A213501 ... w != max(|w-x|,|x-y|)
A213502 ... x != min(|w-x|,|x-y|)
...
A211795 includes a guide for sequences that count 4-tuples (w,x,y,z) having all terms in {0,...,n} and satisfying selected properties. Some of the sequences indexed at A211795 satisfy recurrences that are represented in the above list.
Partial sums of the numbers congruent to {1,3} mod 6 (see A047241). - Philippe Deléham, Mar 16 2014

Examples

			a(1)=4 counts these (x,y,z): (0,0,0), (1,1,1), (0,1,0), (1,0,1).
Numbers congruent to {1, 3} mod 6: 1, 3, 7, 9, 13, 15, 19, ...
a(0) = 1;
a(1) = 1 + 3 = 4;
a(2) = 1 + 3 + 7 = 11;
a(3) = 1 + 3 + 7 + 9 = 20;
a(4) = 1 + 3 + 7 + 9 + 13 = 33;
a(5) = 1 + 3 + 7 + 9 + 13 + 15 = 48; etc. - _Philippe Deléham_, Mar 16 2014
		

References

  • A. Barvinok, Lattice Points and Lattice Polytopes, Chapter 7 in Handbook of Discrete and Computational Geometry, CRC Press, 1997, 133-152.
  • P. Gritzmann and J. M. Wills, Lattice Points, Chapter 3.2 in Handbook of Convex Geometry, vol. B, North-Holland, 1993, 765-797.

Crossrefs

Programs

  • Mathematica
    t = Compile[{{n, _Integer}}, Module[{s = 0},
    (Do[If[Abs[w - x] == Abs[x - y], s = s + 1],
    {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
    m = Map[t[#] &, Range[0, 50]]   (* A212959 *)
  • PARI
    a(n)=(6*n^2+8*n+3)\/4 \\ Charles R Greathouse IV, Jul 28 2015

Formula

a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: (1+2*x+3*x^2)/((1+x)*(1-x)^3).
a(n) + A212960(n) = (n+1)^3.
a(n) = (6*n^2 + 8*n + 3 + (-1)^n)/4. - Luce ETIENNE, Apr 05 2014
a(n) = 2*A069905(3*(n+1)+2) - 3*(n+1). - Ayoub Saber Rguez, Aug 31 2021

A052928 The even numbers repeated.

Original entry on oeis.org

0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 46, 48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62, 64, 64, 66, 66, 68, 68, 70, 70, 72, 72
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) is also the binary rank of the complete graph K(n). - Alessandro Cosentino (cosenal(AT)gmail.com), Feb 07 2009
Let I=I_n be the n X n identity matrix and P=P_n be the incidence matrix of the cycle (1,2,3,...,n). Then, for n >= 6, a(n) is the number of (0,1) n X n matrices A <= P^(-1)+I+P having exactly two 1's in every row and column with perA=2. - Vladimir Shevelev, Apr 12 2010
a(n+2) is the number of symmetry allowed, linearly independent terms at n-th order in the series expansion of the (E+A)xe vibronic perturbation matrix, H(Q) (cf. Eisfeld & Viel). - Bradley Klee, Jul 21 2015
The arithmetic function v_2(n,1) as defined in A289187. - Robert Price, Aug 22 2017
For n > 1, also the chromatic number of the n X n white bishop graph. - Eric W. Weisstein, Nov 17 2017
For n > 2, also the maximum vertex degree of the n-polygon diagonal intersection graph. - Eric W. Weisstein, Mar 23 2018
For n >= 2, a(n+2) gives the minimum weight of a Boolean function of algebraic degree at most n-2 whose support contains n linearly independent elements. - Christof Beierle, Nov 25 2019

References

  • C. D. Godsil and G. Royle, Algebraic Graph Theory, Springer, 2001, page 181. - Alessandro Cosentino (cosenal(AT)gmail.com), Feb 07 2009
  • V. S. Shevelyov (Shevelev), Extension of the Moser class of four-line Latin rectangles, DAN Ukrainy, 3(1992),15-19.

Crossrefs

First differences: A010673; partial sums: A007590; partial sums of partial sums: A212964(n+1).
Complement of A109613 with respect to universe A004526. - Guenther Schrack, Dec 07 2017
Is first differences of A099392. Fixed point sequence: A005843. - Guenther Schrack, May 30 2019
For n >= 3, A329822(n) gives the minimum weight of a Boolean function of algebraic degree at most n-3 whose support contains n linearly independent elements. - Christof Beierle, Nov 25 2019

Programs

  • Haskell
    a052928 = (* 2) . flip div 2
    a052928_list = 0 : 0 : map (+ 2) a052928_list
    -- Reinhard Zumkeller, Jun 20 2015
  • Magma
    [2*Floor(n/2) : n in [0..50]]; // Wesley Ivan Hurt, Sep 13 2014
    
  • Maple
    spec := [S,{S=Union(Sequence(Prod(Z,Z)),Prod(Sequence(Z),Sequence(Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    Flatten[Table[{2n, 2n}, {n, 0, 39}]] (* Alonso del Arte, Jun 24 2012 *)
    With[{ev=2Range[0,40]},Riffle[ev,ev]] (* Harvey P. Dale, May 08 2021 *)
    Table[Round[n + 1/2], {n, -1, 72}] (* Ed Pegg Jr, Jul 28 2025 *)
  • PARI
    a(n)=n\2*2 \\ Charles R Greathouse IV, Nov 20 2011
    

Formula

a(n) = 2*floor(n/2).
G.f.: 2*x^2/((-1+x)^2*(1+x)).
a(n) + a(n+1) + 2 - 2*n = 0.
a(n) = n - 1/2 + (-1)^n/2.
a(n) = n + Sum_{k=1..n} (-1)^k. - William A. Tedeschi, Mar 20 2008
a(n) = a(n-1) + a(n-2) - a(n-3). - R. J. Mathar, Feb 19 2010
a(n) = |A123684(n) - A064455(n)| = A032766(n) - A008619(n-1). - Jaroslav Krizek, Mar 22 2011
For n > 0, a(n) = floor(sqrt(n^2+(-1)^n)). - Francesco Daddi, Aug 02 2011
a(n) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=0 and b(k)=2^k for k>0. - Philippe Deléham, Oct 19 2011
a(n) = A109613(n) - 1. - M. F. Hasler, Oct 22 2012
a(n) = n - (n mod 2). - Wesley Ivan Hurt, Jun 29 2013
a(n) = a(a(n-1)) + a(n-a(n-1)) for n>2. - Nathan Fox, Jul 24 2016
a(n) = 2*A004526(n). - Filip Zaludek, Oct 28 2016
E.g.f.: x*exp(x) - sinh(x). - Ilya Gutkovskiy, Oct 28 2016
a(-n) = -a(n+1); a(n) = A005843(A004526(n)). - Guenther Schrack, Sep 11 2018
From Guenther Schrack, May 29 2019: (Start)
a(b(n)) = b(n) + ((-1)^b(n) - 1)/2 for any sequence b(n) of offset 0.
a(a(n)) = a(n), idempotent.
a(A086970(n)) = A124356(n-1) for n > 1.
a(A000124(n)) = A192447(n+1).
a(n)*a(n+1)/2 = A007590(n), also equals partial sums of a(n).
A007590(a(n)) = 2*A008794(n). (End)

Extensions

More terms from James Sellers, Jun 05 2000
Removed duplicate of recurrence; corrected original recurrence and g.f. against offset - R. J. Mathar, Feb 19 2010

A099392 a(n) = floor((n^2 - 2*n + 3)/2).

Original entry on oeis.org

1, 1, 3, 5, 9, 13, 19, 25, 33, 41, 51, 61, 73, 85, 99, 113, 129, 145, 163, 181, 201, 221, 243, 265, 289, 313, 339, 365, 393, 421, 451, 481, 513, 545, 579, 613, 649, 685, 723, 761, 801, 841, 883, 925, 969, 1013, 1059, 1105, 1153, 1201, 1251, 1301, 1353, 1405
Offset: 1

Views

Author

Ralf Stephan following a suggestion from Luke Pebody, Oct 20 2004

Keywords

Crossrefs

Differs from A085913 at n = 61. Apart from leading term, identical to A080827.
Cf. A000217, A001844, A002522, A007494, A007590, A058331 (bisections).
From Guenther Schrack, Apr 17 2018: (Start)
First differences: A052928.
Partial sums: A212964(n) + n for n > 0.
Also A058331 and A001844 interleaved. (End)

Programs

  • Mathematica
    Array[Floor[(#^2 - 2 # + 3)/2] &, 54] (* or *)
    Rest@ CoefficientList[Series[x (-1 + x - x^2 - x^3)/((1 + x) (x - 1)^3), {x, 0, 54}], x] (* Michael De Vlieger, Apr 21 2018 *)
  • PARI
    a(n)=(n^2+3)\2-n \\ Charles R Greathouse IV, Aug 01 2013

Formula

a(n) = ceiling(n^2/2)-n+1. - Paul Barry, Jul 16 2006; index shifted by R. J. Mathar, Jul 29 2007
a(n) = ceiling(A002522(n-1)/2). - Branko Curgus, Sep 02 2007
From R. J. Mathar, Feb 20 2011: (Start)
G.f.: x *( -1+x-x^2-x^3 ) / ( (1+x)*(x-1)^3 ).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
a(n+1) = (3 + 2*n^2 + (-1)^n)/4. (End)
a(n) = A007590(n-1) + 1 for n >= 2. - Richard R. Forberg, Aug 01 2013
a(n) = A000217(n) - A007494(n-1). - Bui Quang Tuan, Mar 27 2015
From Guenther Schrack, Apr 17 2018: (Start)
a(n) = (2*n^2 - 4*n + 5 -(-1)^n)/4.
a(n+2) = a(n) + 2*n for n > 0.
a(n) = 2*A033683(n-1) - 1 for n > 0.
a(n) = A047838(n-1) + 2 for n > 2.
a(n) = A074148(n-1) - n + 2 for n > 1.
a(n) = A183575(n-3) + 3 for n > 3.
a(n) = 2*A290743(n-1) - 3 for n > 0.
a(n) = 2*A290743(n-2) + A109613(n-5) for n > 4.
a(n) = A074148(n) - A014601(n-1) for n > 0. (End)
Sum_{n>=1} 1/a(n) = tanh(Pi/2)*Pi/2 + coth(Pi/sqrt(2))*Pi/(2*sqrt(2)) + 1/2. - Amiram Eldar, Sep 16 2022
E.g.f.: ((2 - x + x^2)*cosh(x) + (3 - x + x^2)*sinh(x) - 2)/2. - Stefano Spezia, Jan 28 2024

A334187 Number T(n,k) of k-element subsets of [n] avoiding 3-term arithmetic progressions; triangle T(n,k), n>=0, 0<=k<=A003002(n), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 4, 6, 2, 1, 5, 10, 6, 1, 1, 6, 15, 14, 4, 1, 7, 21, 26, 10, 1, 8, 28, 44, 25, 1, 9, 36, 68, 51, 4, 1, 10, 45, 100, 98, 24, 1, 11, 55, 140, 165, 64, 7, 1, 12, 66, 190, 267, 144, 25, 1, 13, 78, 250, 407, 284, 78, 6, 1, 14, 91, 322, 601, 520, 188, 22, 1
Offset: 0

Views

Author

Alois P. Heinz, May 14 2020

Keywords

Comments

T(n,k) is defined for all n >= 0 and k >= 0. The triangle contains only elements with 0 <= k <= A003002(n). T(n,k) = 0 for k > A003002(n).

Examples

			Triangle T(n,k) begins:
  1;
  1,  1;
  1,  2,   1;
  1,  3,   3;
  1,  4,   6,   2;
  1,  5,  10,   6,    1;
  1,  6,  15,  14,    4;
  1,  7,  21,  26,   10;
  1,  8,  28,  44,   25;
  1,  9,  36,  68,   51,    4;
  1, 10,  45, 100,   98,   24;
  1, 11,  55, 140,  165,   64,   7;
  1, 12,  66, 190,  267,  144,  25;
  1, 13,  78, 250,  407,  284,  78,   6;
  1, 14,  91, 322,  601,  520, 188,  22,  1;
  1, 15, 105, 406,  849,  862, 386,  64,  4;
  1, 16, 120, 504, 1175, 1394, 763, 164, 14;
  ...
		

Crossrefs

Columns k=0-4 give: A000012, A000027, A000217(n-1), A212964(n-1), A300760.
Row sums give A051013.
Last elements of rows give A262347.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, 1, b(n-1, s)+ `if`(
          ormap(j-> 2*j-n in s, s), 0, expand(x*b(n-1, s union {n}))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, {})):
    seq(T(n), n=0..16);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0, 1, b[n-1, s] + If[AnyTrue[s, MemberQ[s, 2 # - n]&], 0, Expand[x b[n-1, s ~Union~ {n}]]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, {}]];
    T /@ Range[0, 16] // Flatten (* Jean-François Alcover, May 30 2020, after Maple *)

Formula

T(n,k) = Sum_{j=0..n} A334892(j,k).
T(n,A003002(n)) = A262347(n).

A381476 Triangle read by rows: T(n,k) is the number of subsets of {1..n} with k elements such that every pair of distinct elements has a different difference, 0 <= k <= A143824(n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 4, 6, 2, 1, 5, 10, 6, 1, 6, 15, 14, 1, 7, 21, 26, 2, 1, 8, 28, 44, 10, 1, 9, 36, 68, 26, 1, 10, 45, 100, 60, 1, 11, 55, 140, 110, 1, 12, 66, 190, 190, 4, 1, 13, 78, 250, 304, 22, 1, 14, 91, 322, 466, 68, 1, 15, 105, 406, 676, 156
Offset: 0

Views

Author

Andrew Howroyd, Mar 27 2025

Keywords

Comments

Equivalently, a(n) is the number of Sidon sets of {1..n} of size k.

Examples

			Triangle begins:
   0 | 1;
   1 | 1,  1;
   2 | 1,  2,  1;
   3 | 1,  3,  3;
   4 | 1,  4,  6,   2;
   5 | 1,  5, 10,   6;
   6 | 1,  6, 15,  14;
   7 | 1,  7, 21,  26,   2;
   8 | 1,  8, 28,  44,  10;
   9 | 1,  9, 36,  68,  26;
  10 | 1, 10, 45, 100,  60;
  11 | 1, 11, 55, 140, 110;
  12 | 1, 12, 66, 190, 190, 4;
  ...
		

Crossrefs

Columns 0..5 are A000012, A001477, A161680, A212964(n-1), A241688, A241689, A241690.
Row sums are A143823.

Programs

  • PARI
    row(n)={
      local(L=List());
      my(recurse(k,r,b,w)=
          if(k > n, if(r>=#L,listput(L,0)); L[1+r]++,
             self()(k+1, r, b, w);
             b+=1<
    				

Formula

T(n,A143824(n)) = A382395(n).

A213759 Principal diagonal of the convolution array A213783.

Original entry on oeis.org

1, 4, 11, 22, 39, 62, 93, 132, 181, 240, 311, 394, 491, 602, 729, 872, 1033, 1212, 1411, 1630, 1871, 2134, 2421, 2732, 3069, 3432, 3823, 4242, 4691, 5170, 5681, 6224, 6801, 7412, 8059, 8742, 9463, 10222, 11021, 11860, 12741, 13664, 14631
Offset: 1

Views

Author

Clark Kimberling, Jun 22 2012

Keywords

Crossrefs

Partial sums of A047838. - Guenther Schrack, May 24 2018

Programs

  • Mathematica
    b[n_] := Floor[(n + 2)/2]; c[n_] := Floor[(n + 1)/2];
    t[n_, k_] := Sum[b[k - i] c[n + i], {i, 0, k - 1}]
    TableForm[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]]
    Flatten[Table[t[n - k + 1, k], {n, 12}, {k, n, 1, -1}]]
    r[n_] := Table[t[n, k], {k, 1, 60}]  (* A213783 *)
    Table[t[n, n], {n, 1, 40}] (* A213759 *)
    LinearRecurrence[{3,-2,-2,3,-1},{1,4,11,22,39},50] (* Harvey P. Dale, Jul 22 2014 *)

Formula

a(n) = (3 - 3*(-1)^n - 4*n + 18*n^2 + 4*n^3)/24.
a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5).
G.f.: x*(1 + x + x^2 - x^3)/((1 - x)^4 *(1 + x)).
a(n+1) = a(n) + A047838(n+2) for n > 0. - Guenther Schrack, May 24 2018
a(n) = A212964(n+2) - n for n > 0. - Guenther Schrack, May 30 2018

A300760 Number of ways to select 4 numbers from the set of the first n natural numbers avoiding 3-term arithmetic progressions.

Original entry on oeis.org

0, 1, 4, 10, 25, 51, 98, 165, 267, 407, 601, 849, 1175, 1580, 2089, 2703, 3452, 4338, 5395, 6622, 8058, 9706, 11606, 13758, 16210, 18963, 22066, 25520, 29379, 33645, 38376, 43571, 49293, 55545, 62391, 69831, 77937, 86710, 96223, 106477, 117550, 129444, 142241
Offset: 4

Views

Author

Heinrich Ludwig, Mar 12 2018

Keywords

Examples

			There are 4 selections of 4 natural numbers from the set {1,2,3,4,5,6} free of 3-term arithmetic progressions: {1,2,4,5}, {1,2,5,6}, {1,3,4,6}, {2,3,5,6}.
		

Crossrefs

Column k=4 of A334187.

Programs

  • Mathematica
    Array[(#^4 - 12 #^3 + 51 #^2 - 78 # + 32)/24 + Boole[OddQ@ #] (-# + 2)/4 - Boole[Mod[#, 3] == 0]/3 - Boole[Mod[#, 4] == 0] &, 43, 4] (* Michael De Vlieger, Mar 14 2018 *)
    LinearRecurrence[{2,0,-1,0,-2,2,0,1,0,-2,1},{0,1,4,10,25,51,98,165,267,407,601},50] (* Harvey P. Dale, Feb 18 2024 *)
  • PARI
    concat(0, Vec(x^5*(1 + 2*x + 2*x^2 + 6*x^3 + 5*x^4 + 8*x^5) / ((1 - x)^5*(1 + x)^2*(1 + x^2)*(1 + x + x^2)) + O(x^60))) \\ Colin Barker, Aug 06 2018

Formula

a(n) = (n^4 - 12*n^3 + 51*n^2 - 78*n + 32)/24 + b(n) + c(n), where
b(n) = 0 for n even
b(n) = (-n + 2)/4 for n odd
c(n) = 0 for n == 1,2,5,7,10,11 (mod 12)
c(n) = -1/3 for n == 3,6,9 (mod 12)
c(n) = -4/3 for n == 0 (mod 12)
c(n) = -1 for n == 4,8 (mod 12).
a(n) = (n^4 - 12*n^3 + 51*n^2 - 78*n + 32)/24 + (n == 1 (mod 2))*(-n + 2)/4 - (n == 0 (mod 3))/3 - (n == 0 (mod 4)).
From Colin Barker, Mar 12 2018: (Start)
G.f.: x^5*(1 + 2*x + 2*x^2 + 6*x^3 + 5*x^4 + 8*x^5) / ((1 - x)^5*(1 + x)^2*(1 + x^2)*(1 + x + x^2)).
a(n) = 2*a(n-1) - a(n-3) - 2*a(n-5) + 2*a(n-6) + a(n-8) - 2*a(n-10) + a(n-11) for n>14.
(End)

A300254 a(n) = 25*(n + 1)*(4*n + 3)*(5*n + 4)/3.

Original entry on oeis.org

100, 1050, 3850, 9500, 19000, 33350, 53550, 80600, 115500, 159250, 212850, 277300, 353600, 442750, 545750, 663600, 797300, 947850, 1116250, 1303500, 1510600, 1738550, 1988350, 2261000, 2557500, 2878850, 3226050, 3600100, 4002000, 4432750, 4893350, 5384800, 5908100, 6464250
Offset: 0

Views

Author

Bruno Berselli, Mar 12 2018

Keywords

Comments

Hirschhorn has discovered that p(20*n+11,4) + p(20*n+12,4) + p(20*n+13,4) = 25*(n + 1)*(4*n + 3)*(5*n + 4)/3, where p(m,k) denote the number of partitions of m into at most k parts. Therefore, p(20*n+11,4) + p(20*n+12,4) + p(20*n+13,4) == 0 (mod 50) [see Hirschhorn's paper in References section].
a(n) == 0 (mod 3) if n is of the form 2*h + 3*floor(h/3 + 2/3) + 1.
a(n) == 0 (mod 7) if n is a member of A047278.

References

  • Michael D. Hirschhorn, Congruences modulo 5 for partitions into at most four parts, The Fibonacci Quarterly, Vol. 56, Number 1, 2018, pages 32-37 [the equation 1.7 contains a typo].

Crossrefs

Subsequence of A014112, A212964, A228958, A268684.

Programs

  • GAP
    List([0..40], n -> 25*(n+1)*(4*n+3)*(5*n+4)/3);
    
  • Julia
    [div(25*(n+1)*(4*n+3)*(5*n+4), 3) for n in 0:40] |> println
    
  • Magma
    [25*(n+1)*(4*n+3)*(5*n+4)/3: n in [0..40]];
    
  • Mathematica
    Table[25 (n + 1) (4 n + 3) (5 n + 4)/3, {n, 0, 40}]
  • Maxima
    makelist(25*(n+1)*(4*n+3)*(5*n+4)/3, n, 0, 40);
    
  • PARI
    vector(40, n, n--; 25*(n+1)*(4*n+3)*(5*n+4)/3)
    
  • PARI
    Vec(50*(2 + 13*x + 5*x^2) / (1 - x)^4 + O(x^60)) \\ Colin Barker, Mar 13 2018
  • Python
    [25*(n+1)*(4*n+3)*(5*n+4)/3 for n in range(40)]
    
  • Sage
    [25*(n+1)*(4*n+3)*(5*n+4)/3 for n in (0..40)]
    

Formula

O.g.f.: 50*(2 + 13*x + 5*x^2)/(1 - x)^4 [formula 4.3 in Hirschhorn's paper].
E.g.f.: 25*(12 + 114*x + 111*x^2 + 20*x^3)*exp(x)/3.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4)
a(n) = A014112(10*n+8) = A212964(10*n+9) = A228958(10*n+8) = A268684(5*n+4).

A338796 Triangle T read by rows: T(n, k) is the k-th row sum of the symmetric Toeplitz matrix M(n) whose first row consists of a single zero followed by successive positive integers repeated (A004526).

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 4, 3, 3, 4, 6, 5, 4, 5, 6, 9, 7, 6, 6, 7, 9, 12, 10, 8, 8, 8, 10, 12, 16, 13, 11, 10, 10, 11, 13, 16, 20, 17, 14, 13, 12, 13, 14, 17, 20, 25, 21, 18, 16, 15, 15, 16, 18, 21, 25, 30, 26, 22, 20, 18, 18, 18, 20, 22, 26, 30, 36, 31, 27, 24, 22, 21, 21, 22, 24, 27, 31, 36
Offset: 1

Views

Author

Stefano Spezia, Nov 12 2020

Keywords

Examples

			n\k| 1 2 3 4 5 6
---+------------
1  | 0
2  | 1 1
3  | 2 2 2
4  | 4 3 3 4
5  | 6 5 4 5 6
6  | 9 7 6 6 7 9
...
For n = 4 the matrix M(4) is
        0 1 1 2
        1 0 1 1
        1 1 0 1
        2 1 1 0
and therefore T(4, 1) = 4, T(4, 2) = 3, T(4, 3) = 3 and T(4, 4) = 4.
		

Crossrefs

Cf. A004526.
Cf. A002378 (conjectured determinant of M(2n+1)), A083392 (conjectured determinant of M(n+1)), A332566 (permanent of M(n)), A333119 (k-th super- and subdiagonal sums of the matrix M(n)), A338456 (hafnian of M(n)).

Programs

  • Mathematica
    T[n_,k_]:=((-1)^k+(-1)^(n-k+1)+4k^2+4n+2n^2-4k(n+1))/8; Flatten[Table[T[n,k],{n,12},{k,n}]] (* or *)
    r[n_]:=Table[SeriesCoefficient[(2x^3y^2+y^2(1+y)+x^2(y-3y^2)-x(-1+2y+y^2))/((1-x)^3(1+x)(1-y)^3(1+y)),{x,0,i},{y,0,j}],{i,n,n},{j, n}]; Flatten[Array[r,12]] (* or *)
    r[n_]:=Table[SeriesCoefficient[1/8 E^(-x-y)(-1+E^(2 x)+2 E^(2 (x+y))(x (3+x)-2 x y+2 y^2)),{x, 0, i},{y, 0, j}]i!j!,{i, n, n},{j, n}]; Flatten[Array[r, 12]]
  • PARI
    tm(n) = {my(m = matrix(n, n, i, j, if (i==1, j\2, if (j==1, i\2)))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
    T(n, k) = my(m = tm(n)); sum(i=1, n, m[i, k]);
    matrix(10, 10, n, k, if (n>=k, T(n,k), 0)) \\ Michel Marcus, Nov 12 2020

Formula

O.g.f.: (2*x^3*y^2 + y^2*(1 + y) + x^2*(y - 3*y^2) - x*(-1 + 2*y + y^2))/((1 - x)^3*(1 + x) *(1 - y)^3*(1 + y)).
E.g.f.: exp(-x-y)*(exp(2*x) + 2*exp(2*(x+y))*(x*(3 + x) - 2*x*y + 2*y^2 - 1))/8.
T(n, k) = ((-1)^k + (-1)^(n-k+1) + 4*k^2 + 4*n + 2*n^2 - 4*k*(n + 1))/8.
T(n, 1) = T(n, n) = A002620(n).
T(n, 2) = A033638(n-1).
T(n, 3) = A290743(n-2).
Sum_{k=1..n} T(n, k) = A212964(n+1).
Showing 1-10 of 11 results. Next