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-4 of 4 results.

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

A032438 a(n) = n^2 - floor((n+1)/2)^2.

Original entry on oeis.org

0, 0, 3, 5, 12, 16, 27, 33, 48, 56, 75, 85, 108, 120, 147, 161, 192, 208, 243, 261, 300, 320, 363, 385, 432, 456, 507, 533, 588, 616, 675, 705, 768, 800, 867, 901, 972, 1008, 1083, 1121, 1200, 1240, 1323, 1365, 1452, 1496, 1587, 1633, 1728, 1776, 1875, 1925
Offset: 0

Views

Author

Keywords

Comments

The answer to a question from Mike and Laurie Crain (2crains(AT)concentric.net): how many even numbers are there in an n X n multiplication table starting at 1 X 1?
a(n+1) is the number of pairs (x,y) with x and y in {0,...,n}, x and y of the same parity, and x+y >= n. - Clark Kimberling, Jul 02 2012
From J. M. Bergot, Aug 08 2013: (Start)
Define a triangle to have T(1,1)=0 and T(n,c) = n^2 - c^2. The difference of the sum of the terms in antidiagonal(n+1) and those in antidiagonal(n)=a(n).
Column 0 is vertical and T(n,n)=0. The first few rows are 0; 3,0; 8,5,0; 15,12,7,0; 24,21,16,9,0; 35,32,27,20,11,0; the first few antidiagonals are 0; 3; 8,0; 15,5; 24,12,0; 35,21,7; 48,32,16,0; the first few sum of terms in the antidiagonals are 0, 3, 8, 20, 36, 63, 96, 144, 200, 275, 360, 468, 588, 735, 896, 1088, 1296, 1539. (End)
Sum of the largest parts in the partitions of 2n into two distinct odd parts. For example, a(5) = 16; the partitions of 2(5) = 10 into two distinct odd parts are (9,1) and (7,3). The sum of the largest parts is then 9+7 = 16. - Wesley Ivan Hurt, Nov 27 2017

Crossrefs

First differences are in A059029, partial sums in A143785.

Programs

  • Magma
    [n^2-Floor( (n+1)/2 )^2 : n in [0..60]]; // Vincenzo Librandi, Sep 27 2011
    
  • Maple
    A032438:=n->n^2-floor((n+1)/2)^2; seq(A032438(n), n=0..100) # Wesley Ivan Hurt, Nov 25 2013
  • Mathematica
    Table[n^2-Floor[((n+1)/2)]^2,{n,0,50}] (* or *) LinearRecurrence[ {1,2,-2,-1,1},{0,0,3,5,12},51]
  • PARI
    a(n)=n^2 - ((n+1)\2)^2 \\ Charles R Greathouse IV, Feb 19 2017

Formula

a(n) = n^2 - A008794(n+1).
G.f.: x^2*(x^2 + 2*x + 3)/(1-x^2)^2/(1-x). - Ralf Stephan, Jun 10 2003
a(n) = (1/8)*(2*n*(3*n-1)+(2*n+1)*(-1)^n-1). a(-n-1) = A014255(n). - Bruno Berselli, Sep 27 2011
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), n > 4. - Harvey P. Dale, Nov 24 2011
E.g.f.: (x*(1 + 3*x)*cosh(x) + (3*x^2 + 3*x - 1)*sinh(x))/4. - Stefano Spezia, Aug 01 2022

A005996 G.f.: 2*(1-x^3)/((1-x)^5*(1+x)^2).

Original entry on oeis.org

2, 6, 16, 30, 54, 84, 128, 180, 250, 330, 432, 546, 686, 840, 1024, 1224, 1458, 1710, 2000, 2310, 2662, 3036, 3456, 3900, 4394, 4914, 5488, 6090, 6750, 7440, 8192, 8976, 9826, 10710, 11664, 12654, 13718, 14820, 16000, 17220, 18522, 19866, 21296, 22770, 24334
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of triples (w,x,y) having all terms in {0,...,n} and wClark Kimberling, Jun 10 2012
a(n) is also the sum of all elements of the square matrix M(n-1) = M1(n-1) x M2(n-1), where M1(n) is the square matrix with elements m1(i,j)= (1+(-1)^(i+j+1))/2, A057212; and M2(n) is the square matrix given by m2(i,j)= (1+(-1)^(i+j))/2, A057212. - Enrique Pérez Herrero, Jun 15 2013
Also the number of longest paths in the (n+1)-web graph for n > 2. - Eric W. Weisstein, Mar 27 2018
a(n) also is the number of undirected rook moves on an n X n chessboard, taken up to 180 degree rotation and axial reflections (horizontal and vertical), for n >= 2. - Hilko Koning, Aug 16 2025

References

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

Crossrefs

Essentially twice A034828.

Programs

  • Mathematica
    Table[(1/4)*(1 + n)*(-2 + 5*n + n^2 + 2*Ceiling[1/2 - n/2] - 4*Floor[n/2]), {n, 1, 200}] (* Enrique Pérez Herrero, Aug 03 2012 *)
    CoefficientList[Series[2 (1 - x^3)/((1 - x)^5 (1 + x)^2), {x, 0, 40}], x] (* Harvey P. Dale, Apr 08 2013 *)
    LinearRecurrence[{2, 1, -4, 1, 2, -1}, {2, 6, 16, 30, 54, 84}, 40] (* Harvey P. Dale, Apr 08 2013 *)
    Table[(n + 1) (2 n (n + 2) + 1 - (-1)^n)/8, {n, 20}] (* Eric W. Weisstein, Mar 27 2018 *)

Formula

a(n) = 2*(A006918(n) + A006918(n-1) + A006918(n-2)), n>1. - Ralf Stephan, Apr 26 2003
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6), with a(1)=2, a(2)=6, a(3)=16, a(4)=30, a(5)=54, a(6)=84. - Harvey P. Dale, Apr 08 2013
From Ayoub Saber Rguez, Nov 20 2021: (Start)
a(n) = A143785(n) - A002620(n+1).
a(n) = A128624(n) + A002620(n+1).
a(n) = (n^3 + 3*n^2 + 2*n + 1 + n*(n mod 2) - ((n+1) mod 2))/4. (End)

Extensions

Edited by N. J. A. Sloane, Aug 03 2012

A272459 The total number of different isosceles trapezoids, excluding squares, that can be drawn on an n X n square grid where the corners of each individual trapezoid lie on a lattice point.

Original entry on oeis.org

0, 1, 7, 18, 40, 71, 119, 180, 264, 365, 495, 646, 832, 1043, 1295, 1576, 1904, 2265, 2679, 3130, 3640, 4191, 4807, 5468, 6200, 6981, 7839, 8750, 9744, 10795, 11935, 13136, 14432, 15793, 17255, 18786, 20424, 22135, 23959, 25860, 27880, 29981, 32207, 34518
Offset: 1

Views

Author

Christopher J. Shore, Apr 29 2016

Keywords

Comments

This is an observation from a high school mathematics investigation: How many different isosceles trapezoids can be drawn on an n X n grid such that the corners of each individual trapezoid lie on a lattice point? The sequence gives the total number of different trapezoids that can be drawn.
There are two "families" or types of trapezoids that can be drawn on a grid. The first is where the parallel sides are drawn horizontally on the grid. The second is where the parallel sides are drawn diagonally with a gradient of 1. The number in each type follow a pattern.
1 X 1 grid: No trapezoids of either type can be drawn.
2 X 2 grid: 1 trapezoid of type 2. One parallel side is drawn diagonally through 1 square (having length sqrt(2)) and the other is drawn diagonally through two squares (length 2*sqrt(2)). Thus, the non-parallel sides are drawn horizontally or vertically to join between the parallel sides (each length 1).
3 X 3 grid: 3 trapezoids of type 1 and 4 trapezoids of type 2. The 3 trapezoids of type 1 are constructed by one parallel line drawn horizontally with length 3, the other parallel line drawn with length 1 and the perpendicular heights being successively 1, 2 and 3. Type-2 trapezoids are constructed in the same way as outlined above but with varying lengths and heights.
4 X 4 grid: 8 type-1 trapezoids and 10 type-2 trapezoids.
5 X 5 grid: 20 type-1 trapezoids and 20 type-2 trapezoids.
Hence the pattern is as follows:
Type 1 Type 2 Total
1 X 1 grid 0 0 0
2 X 2 grid 0 1 1
3 X 3 grid 3 4 7
4 X 4 grid 8 10 18
5 X 5 grid 20 20 40
6 X 6 grid 36 35 71
7 X 7 grid 63 56 119

Crossrefs

Programs

  • Magma
    [(n*(-1-3*(-1)^n-12*n+10*n^2))/24 : n in [1..60]]; // Wesley Ivan Hurt, Sep 12 2016
  • Maple
    A272459:=n->(n*(-1-3*(-1)^n-12*n+10*n^2))/24: seq(A272459(n), n=1..60); # Wesley Ivan Hurt, Sep 12 2016
  • Mathematica
    CoefficientList[Series[x^2 (1 + 5 x + 3 x^2 + x^3)/((1 - x)^4 (1 + x)^2), {x, 0, 44}], x] (* Michael De Vlieger, May 08 2016 *)
  • PARI
    concat(0, Vec(x^2*(1+5*x+3*x^2+x^3)/((1-x)^4*(1+x)^2) + O(x^50))) \\ Colin Barker, May 07 2016
    

Formula

a(n) = Sum_{k=0..n} A032438(k) + A000292(n-1). (conjectured)
a(n) = A143785(n-2) + A000292(n-1). (conjectured)
From Colin Barker, May 07 2016: (Start)
a(n) = (n*(-1 - 3*(-1)^n - 12*n + 10*n^2))/24.
a(n) = (5*n^3 - 6*n^2 - 2*n)/12 for n even.
a(n) = (5*n^3 - 6*n^2 + n)/12 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
G.f.: x^2*(1+5*x+3*x^2+x^3) / ((1-x)^4*(1+x)^2).
(End)
Showing 1-4 of 4 results.