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.

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

This page as a plain text file.
%I A212959 #81 Dec 28 2021 00:20:03
%S A212959 1,4,11,20,33,48,67,88,113,140,171,204,241,280,323,368,417,468,523,
%T A212959 580,641,704,771,840,913,988,1067,1148,1233,1320,1411,1504,1601,1700,
%U A212959 1803,1908,2017,2128,2243,2360,2481,2604,2731,2860,2993,3128,3267
%N A212959 Number of (w,x,y) such that w,x,y are all in {0,...,n} and |w-x| = |x-y|.
%C A212959 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):
%C A212959   A: 2,  0, -2,  1, i.e., a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4);
%C A212959   B: 3, -2, -2,  3, -1;
%C A212959   C: 4, -6,  4, -1;
%C A212959   D: 1,  2, -2, -1,  1;
%C A212959   E: 2,  1, -4,  1,  2, -1;
%C A212959   F: 2, -1,  1, -2,  1;
%C A212959   G: 2, -1,  0,  1, -2,  1;
%C A212959   H: 2, -1,  2, -4,  2, -1,  2, -1;
%C A212959   I: 3, -3,  2, -3,  3, -1;
%C A212959   J: 4, -7,  8, -7,  4, -1.
%C A212959   ...
%C A212959 A212959 ... |w-x|=|x-y| ...... recurrence type A
%C A212959 A212960 ... |w-x| != |x-y| ................... B
%C A212959 A212683 ... |w-x| < |x-y| .................... B
%C A212959 A212684 ... |w-x| >= |x-y| ................... B
%C A212959 A212963 ... see entry for definition ......... B
%C A212959 A212964 ... |w-x| < |x-y| < |y-w| ............ B
%C A212959 A006331 ... |w-x| < y ........................ C
%C A212959 A005900 ... |w-x| <= y ....................... C
%C A212959 A212965 ... w = R ............................ D
%C A212959 A212966 ... 2*w = R
%C A212959 A212967 ... w < R ............................ E
%C A212959 A212968 ... w >= R ........................... E
%C A212959 A077043 ... w = x > R ........................ A
%C A212959 A212969 ... w != x and x > R ................. E
%C A212959 A212970 ... w != x and x < R ................. E
%C A212959 A055998 ... w = x + y - 1
%C A212959 A011934 ... w < floor((x+y)/2) ............... B
%C A212959 A182260 ... w > floor((x+y)/2) ............... B
%C A212959 A055232 ... w <= floor((x+y)/2) .............. B
%C A212959 A011934 ... w >= floor((x+y)/2) .............. B
%C A212959 A212971 ... w < floor((x+y)/3) ............... B
%C A212959 A212972 ... w >= floor((x+y)/3) .............. B
%C A212959 A212973 ... w <= floor((x+y)/3) .............. B
%C A212959 A212974 ... w > floor((x+y)/3) ............... B
%C A212959 A212975 ... R is even ........................ E
%C A212959 A212976 ... R is odd ......................... E
%C A212959 A212978 ... R = 2*n - w - x
%C A212959 A212979 ... R = average{w,x,y}
%C A212959 A212980 ... w < x + y and x < y .............. B
%C A212959 A212981 ... w <= x+y and x < y ............... B
%C A212959 A212982 ... w < x + y and x <= y ............. B
%C A212959 A212983 ... w <= x + y and x <= y ............ B
%C A212959 A002623 ... w >= x + y and x <= y ............ B
%C A212959 A087811 ... w = 2*x + y ...................... A
%C A212959 A008805 ... w = 2*x + 2*y .................... D
%C A212959 A000982 ... 2*w = x + y ...................... F
%C A212959 A001318 ... 2*w = 2*x + y .................... F
%C A212959 A001840 ... w = 3*x + y
%C A212959 A212984 ... 3*w = x + y
%C A212959 A212985 ... 3*w = 3*x + y
%C A212959 A001399 ... w = 2*x + 3*y
%C A212959 A212986 ... 2*w = 3*x + y
%C A212959 A008810 ... 3*x = 2*x + y .................... F
%C A212959 A212987 ... 3*w = 2*x + 2*y
%C A212959 A001972 ... w = 4*x + y ...................... G
%C A212959 A212988 ... 4*w = x + y ...................... G
%C A212959 A212989 ... 4*w = 4*x + y
%C A212959 A008812 ... 5*w = 2*x + 3*y
%C A212959 A016061 ... n < w + x + y <= 2*n ............. C
%C A212959 A000292 ... w + x + y <=n .................... C
%C A212959 A000292 ... 2*n < w + x + y <= 3*n ........... C
%C A212959 A212977 ... n/2 < w + x + y <= n
%C A212959 A143785 ... w < R < x ........................ E
%C A212959 A005996 ... w < R <= x ....................... E
%C A212959 A128624 ... w <= R <= x ...................... E
%C A212959 A213041 ... R = 2*|w - x| .................... A
%C A212959 A213045 ... R < 2*|w - x| .................... B
%C A212959 A087035 ... R >= 2*|w - x| ................... B
%C A212959 A213388 ... R <= 2*|w - x| ................... B
%C A212959 A171218 ... M < 2*m .......................... B
%C A212959 A213389 ... R < 2|w - x| ..................... E
%C A212959 A213390 ... M >= 2*m ......................... E
%C A212959 A213391 ... 2*M < 3*m ........................ H
%C A212959 A213392 ... 2*M >= 3*m ....................... H
%C A212959 A213393 ... 2*M > 3*m ........................ H
%C A212959 A213391 ... 2*M <= 3*m ....................... H
%C A212959 A047838 ... w = |x + y - w| .................. A
%C A212959 A213396 ... 2*w < |x + y - w| ................ I
%C A212959 A213397 ... 2*w >= |x + y - w| ............... I
%C A212959 A213400 ... w < R < 2*w
%C A212959 A069894 ... min(|w-x|,|x-y|) = 1
%C A212959 A000384 ... max(|w-x|,|x-y|) = |w-y|
%C A212959 A213395 ... max(|w-x|,|x-y|) = w
%C A212959 A213398 ... min(|w-x|,|x-y|) = x ............. A
%C A212959 A213399 ... max(|w-x|,|x-y|) = x ............. D
%C A212959 A213479 ... max(|w-x|,|x-y|) = w+x+y ......... D
%C A212959 A213480 ... max(|w-x|,|x-y|) != w+x+y ........ E
%C A212959 A006918 ... |w-x| + |x-y| > w+x+y ............ E
%C A212959 A213481 ... |w-x| + |x-y| <= w+x+y ........... E
%C A212959 A213482 ... |w-x| + |x-y| < w+x+y ............ E
%C A212959 A213483 ... |w-x| + |x-y| >= w+x+y ........... E
%C A212959 A213484 ... |w-x|+|x-y|+|y-w| = w+x+y
%C A212959 A213485 ... |w-x|+|x-y|+|y-w| != w+x+y ....... J
%C A212959 A213486 ... |w-x|+|x-y|+|y-w| > w+x+y ........ J
%C A212959 A213487 ... |w-x|+|x-y|+|y-w| >= w+x+y ....... J
%C A212959 A213488 ... |w-x|+|x-y|+|y-w| < w+x+y ........ J
%C A212959 A213489 ... |w-x|+|x-y|+|y-w| <= w+x+y ....... J
%C A212959 A213490 ... w,x,y,|w-x|,|x-y| distinct
%C A212959 A213491 ... w,x,y,|w-x|,|x-y| not distinct
%C A212959 A213493 ... w,x,y,|w-x|,|x-y|,|w-y| distinct
%C A212959 A213495 ... w = min(|w-x|,|x-y|,|w-y|)
%C A212959 A213492 ... w != min(|w-x|,|x-y|,|w-y|)
%C A212959 A213496 ... x != max(|w-x|,|x-y|)
%C A212959 A213498 ... w != max(|w-x|,|x-y|,|w-y|)
%C A212959 A213497 ... w = min(|w-x|,|x-y|)
%C A212959 A213499 ... w != min(|w-x|,|x-y|)
%C A212959 A213501 ... w != max(|w-x|,|x-y|)
%C A212959 A213502 ... x != min(|w-x|,|x-y|)
%C A212959 ...
%C A212959 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.
%C A212959 Partial sums of the numbers congruent to {1,3} mod 6 (see A047241). - _Philippe Deléham_, Mar 16 2014
%D A212959 A. Barvinok, Lattice Points and Lattice Polytopes, Chapter 7 in Handbook of Discrete and Computational Geometry, CRC Press, 1997, 133-152.
%D A212959 P. Gritzmann and J. M. Wills, Lattice Points, Chapter 3.2 in Handbook of Convex Geometry, vol. B, North-Holland, 1993, 765-797.
%H A212959 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F A212959 a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
%F A212959 G.f.: (1+2*x+3*x^2)/((1+x)*(1-x)^3).
%F A212959 a(n) + A212960(n) = (n+1)^3.
%F A212959 a(n) = (6*n^2 + 8*n + 3 + (-1)^n)/4. - _Luce ETIENNE_, Apr 05 2014
%F A212959 a(n) = 2*A069905(3*(n+1)+2) - 3*(n+1). - _Ayoub Saber Rguez_, Aug 31 2021
%e A212959 a(1)=4 counts these (x,y,z): (0,0,0), (1,1,1), (0,1,0), (1,0,1).
%e A212959 Numbers congruent to {1, 3} mod 6: 1, 3, 7, 9, 13, 15, 19, ...
%e A212959 a(0) = 1;
%e A212959 a(1) = 1 + 3 = 4;
%e A212959 a(2) = 1 + 3 + 7 = 11;
%e A212959 a(3) = 1 + 3 + 7 + 9 = 20;
%e A212959 a(4) = 1 + 3 + 7 + 9 + 13 = 33;
%e A212959 a(5) = 1 + 3 + 7 + 9 + 13 + 15 = 48; etc. - _Philippe Deléham_, Mar 16 2014
%t A212959 t = Compile[{{n, _Integer}}, Module[{s = 0},
%t A212959 (Do[If[Abs[w - x] == Abs[x - y], s = s + 1],
%t A212959 {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
%t A212959 m = Map[t[#] &, Range[0, 50]]   (* A212959 *)
%o A212959 (PARI) a(n)=(6*n^2+8*n+3)\/4 \\ _Charles R Greathouse IV_, Jul 28 2015
%Y A212959 Cf. A047241, A211795.
%K A212959 nonn,easy
%O A212959 0,2
%A A212959 _Clark Kimberling_, Jun 01 2012