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-5 of 5 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

A213496 Number of (w,x,y) with all terms in {0,...,n} and x != max(|w-x|,|x-y|).

Original entry on oeis.org

0, 4, 13, 41, 82, 158, 255, 403, 580, 824, 1105, 1469, 1878, 2386, 2947, 3623, 4360, 5228, 6165, 7249, 8410, 9734, 11143, 12731, 14412, 16288, 18265, 20453, 22750, 25274, 27915, 30799, 33808, 37076, 40477, 44153, 47970, 52078, 56335
Offset: 0

Views

Author

Clark Kimberling, Jun 14 2012

Keywords

Comments

For a guide to related sequences, see A212959.

Crossrefs

Programs

  • Mathematica
    t = Compile[{{n, _Integer}}, Module[{s = 0},
    (Do[If[x != Max[Abs[w - x], Abs[x - y]], s = s + 1],
    {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
    m = Map[t[#] &, Range[0, 60]]   (* A213496 *)

Formula

a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6).
G.f.: (4*x + 5*x^2 + 11*x^3 + 3*x^4 + x^5)/((1 - x)^4 (1 + x)^2).
From Ayoub Saber Rguez, Nov 20 2021: (Start)
a(n) = (n+1)^3 - A213399(n).
a(n) = (2*n^3 + 2*n^2 + 3*n + 1 - (2+n+1)*((n+1) mod 2))/2. (End)

A274587 Values of n such that 2*n-1 and 4*n-1 are both triangular numbers.

Original entry on oeis.org

1, 23, 176, 5968, 888778, 30192278, 233944673, 7947232183, 1183597668523, 40207478867501, 311547395822378, 10583440358908726, 1576213585538112676, 53544862512524597468, 414892028679967914251, 14094115694115827467213, 2099065698850118586101173
Offset: 1

Views

Author

Colin Barker, Jun 29 2016

Keywords

Examples

			23 is in the sequence because 2*23-1 = 45, 4*23-1 = 91, and 45 and 91 are both triangular numbers.
		

Crossrefs

Programs

  • Mathematica
    Rest@ CoefficientList[Series[x (1 - 12 x + 560 x^2 - 13236 x^3 + 560 x^4 - 12 x^5 + x^6)/((1 - x) (1 - 34 x + x^2) (1 + 1154 x^2 + x^4)), {x, 0, 17}], x] (* Michael De Vlieger, Jun 30 2016 *)
    LinearRecurrence[{35,-1189,40391,-40391,1189,-35,1},{1,23,176,5968,888778,30192278,233944673},20] (* Harvey P. Dale, Jan 18 2021 *)
  • PARI
    isok(n) = ispolygonal(2*n-1, 3) && ispolygonal(4*n-1, 3)
    
  • PARI
    Vec(x*(1-12*x+560*x^2-13236*x^3+560*x^4-12*x^5+x^6)/((1-x)*(1-34*x+x^2)*(1+1154*x^2+x^4)) + O(x^20))

Formula

Intersection of A174114 and A213399.
G.f.: x*(1-12*x+560*x^2-13236*x^3+560*x^4-12*x^5+x^6) / ((1-x)*(1-34*x+x^2)*(1+1154*x^2+x^4)).

A274682 Numbers n such that 8*n-1 is a triangular number.

Original entry on oeis.org

2, 7, 29, 44, 88, 113, 179, 214, 302, 347, 457, 512, 644, 709, 863, 938, 1114, 1199, 1397, 1492, 1712, 1817, 2059, 2174, 2438, 2563, 2849, 2984, 3292, 3437, 3767, 3922, 4274, 4439, 4813, 4988, 5384, 5569, 5987, 6182, 6622, 6827, 7289, 7504, 7988, 8213, 8719
Offset: 1

Views

Author

Colin Barker, Jul 02 2016

Keywords

Examples

			2 is in the sequence since 8*2 - 1 = 15, and 15 = 1 + 2 + 3 + 4 + 5 is a triangular number. - _Michael B. Porter_, Jul 03 2016
		

Crossrefs

Cf. A000124 (n-1), A174114 (2*n-1), A213399 (4*n-1), A069099 (7*n-1).

Programs

  • Mathematica
    Table[(5 + 3 (-1)^n - 2 (8 + 3 (-1)^n) n + 16 n^2)/4, {n, 47}] (* or *)
    Rest@ CoefficientList[Series[x (2 + 5 x + 18 x^2 + 5 x^3 + 2 x^4)/((1 - x)^3 (1 + x)^2), {x, 0, 47}], x] (* Michael De Vlieger, Jul 02 2016 *)
  • PARI
    isok(n) = ispolygonal(8*n-1, 3)
    
  • PARI
    select(n->ispolygonal(8*n-1, 3), vector(10000, n, n-1))
    
  • PARI
    Vec(x*(2+5*x+18*x^2+5*x^3+2*x^4)/((1-x)^3*(1+x)^2) + O(x^100))

Formula

a(n) = (5+3*(-1)^n-2*(8+3*(-1)^n)*n+16*n^2)/4.
a(n) = (8*n^2-11*n+4)/2 for n even.
a(n) = (8*n^2-5*n+1)/2 for n odd.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>5.
G.f.: x*(2+5*x+18*x^2+5*x^3+2*x^4) / ((1-x)^3*(1+x)^2).

A385406 Triangle read by rows: T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2).

Original entry on oeis.org

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

Views

Author

Werner Schulte, Jun 27 2025

Keywords

Comments

This triangle seen as a sequence yields a permutation of the natural numbers (A000027).

Examples

			Triangle T(n, k) for 1 <= k <= n starts:
n \k :   1   2   3   4   5   6   7   8   9  10  11  12  13
==========================================================
   1 :   1
   2 :   3   2
   3 :   5   4   6
   4 :   9   8  10   7
   5 :  13  12  14  11  15
   6 :  19  18  20  17  21  16
   7 :  25  24  26  23  27  22  28
   8 :  33  32  34  31  35  30  36  29
   9 :  41  40  42  39  43  38  44  37  45
  10 :  51  50  52  49  53  48  54  47  55  46
  11 :  61  60  62  59  63  58  64  57  65  56  66
  12 :  73  72  74  71  75  70  76  69  77  68  78  67
  13 :  85  84  86  83  87  82  88  81  89  80  90  79  91
  etc.
		

Crossrefs

Cf. A080827 (column 1), A128918 (main diagonal), A006003 (row sums), A213399.

Programs

  • Mathematica
    T[n_, k_] := n*(n+1)/2 - Floor[(n-1)/2] - (-1)^k*Floor[k/2]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Amiram Eldar, Jun 28 2025 *)
  • PARI
    T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2)

Formula

T(n, k) = T(n, k-1) - (-1)^k * (k-1) for 1 < k <= n with initial values T(n, 1) = n*(n+1)/2 - floor((n-1)/2) for n >= 1.
T(n, n) = n*(n+1)/2 + (1-n) * (1 - n mod 2) = A128918(n).
T(2*n-1, n) = 2*n^2 - 2*n + 1 - (-1)^n * floor(n/2) = A213399(n-1).
Showing 1-5 of 5 results.