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.

A212683 Number of (w,x,y,z) with all terms in {1,...,n} and |x-y| = w + |y-z|.

This page as a plain text file.
%I A212683 #24 Aug 19 2025 21:06:01
%S A212683 0,0,2,8,22,46,84,138,212,308,430,580,762,978,1232,1526,1864,2248,
%T A212683 2682,3168,3710,4310,4972,5698,6492,7356,8294,9308,10402,11578,12840,
%U A212683 14190,15632,17168,18802,20536,22374,24318,26372,28538,30820
%N A212683 Number of (w,x,y,z) with all terms in {1,...,n} and |x-y| = w + |y-z|.
%C A212683 For a guide to related sequences, see A211795.
%C A212683 Also the number of (w,x,y) with all terms in {0,...,n-1} and |w-x| < |x-y|, see A212959. - _Clark Kimberling_, Jun 02 2012
%H A212683 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).
%F A212683 a(n) = 2*A019298(n-1) for n>=1.
%F A212683 a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5).
%F A212683 G.f.: (2*x^2 + 2*x^3 + 2*x^4)/(1 - 3*x + 2*x^2 + 2*x^3 - 3*x^4 + x^5).
%F A212683 a(n) + A212684(n) = n^3. - _Clark Kimberling_, Jun 02 2012 [corrected by _Jason Yuen_, Aug 19 2025]
%F A212683 a(n) = (2*n^3 - 3*n^2 + 2*n - (n mod 2))/4. - _Ayoub Saber Rguez_, Sep 02 2021
%t A212683 t = Compile[{{n, _Integer}}, Module[{s = 0},
%t A212683 (Do[If[Abs[x - y] == w + Abs[y - z], s = s + 1],
%t A212683 {w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
%t A212683 Map[t[#] &, Range[0, 40]]   (* A212683 *)
%t A212683 %/2  (* A019298 *)
%t A212683 LinearRecurrence[{3, -2, -2, 3, -1}, {0, 0, 2, 8, 22}, 40]
%Y A212683 Cf. A019298, A211795, A212684.
%K A212683 nonn,easy
%O A212683 0,3
%A A212683 _Clark Kimberling_, May 24 2012