login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A212683 Number of (w,x,y,z) with all terms in {1,...,n} and |x-y| = w + |y-z|. 5
0, 0, 2, 8, 22, 46, 84, 138, 212, 308, 430, 580, 762, 978, 1232, 1526, 1864, 2248, 2682, 3168, 3710, 4310, 4972, 5698, 6492, 7356, 8294, 9308, 10402, 11578, 12840, 14190, 15632, 17168, 18802, 20536, 22374, 24318, 26372, 28538, 30820 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

For a guide to related sequences, see A211795.

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

LINKS

Table of n, a(n) for n=0..40.

Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).

FORMULA

a(n) = 2*A019298(n-1) for n>=1.

a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5).

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).

a(n) + A212962(n-1) = n^3. - _Clark Kimberling, Jun 02 2012

a(n) = (2*n^3 - 3*n^2 + 2*n - (n mod 2))/4. - Ayoub Saber Rguez, Sep 02 2021

MATHEMATICA

t = Compile[{{n, _Integer}}, Module[{s = 0},

(Do[If[Abs[x - y] == w + Abs[y - z], s = s + 1],

{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];

Map[t[#] &, Range[0, 40]]   (* A212683 *)

%/2  (* A019298 *)

LinearRecurrence[{3, -2, -2, 3, -1}, {0, 0, 2, 8, 22}, 40]

CROSSREFS

Cf. A019298, A211795, A212962.

Sequence in context: A137101 A284922 A212970 * A346586 A094533 A006696

Adjacent sequences:  A212680 A212681 A212682 * A212684 A212685 A212686

KEYWORD

nonn,easy

AUTHOR

Clark Kimberling, May 24 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 1 04:05 EDT 2022. Contains 357134 sequences. (Running on oeis4.)