login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A213398 Number of (w,x,y) with all terms in {0,...,n} and min(|w-x|,|x-y|) = x. 3
1, 4, 10, 17, 27, 38, 52, 67, 85, 104, 126, 149, 175, 202, 232, 263, 297, 332, 370, 409, 451, 494, 540, 587, 637, 688, 742, 797, 855, 914, 976, 1039, 1105, 1172, 1242, 1313, 1387, 1462, 1540, 1619, 1701, 1784, 1870, 1957, 2047, 2138, 2232, 2327 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

For a guide to related sequences, see A212959.

LINKS

Iain Fox, Table of n, a(n) for n = 0..10000

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

FORMULA

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

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

a(n) = (n+1)^2 + floor(n/2). [Wesley Ivan Hurt, Jul 15 2013]

From Iain Fox, Feb 01 2018: (Start)

E.g.f.: (1 + e^(2*x) * (3 + 14*x + 4*x^2))/(4 * e^x).

a(n) = (4*n^2 + 10*n + (-1)^n + 3)/4.

(End)

MATHEMATICA

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

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

{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];

Map[t[#] &, Range[0, 60]]   (* A213398 *)

LinearRecurrence[{2, 0, -2, 1}, {1, 4, 10, 17}, 50] (* Harvey P. Dale, Aug 05 2019 *)

PROG

(PARI) first(n) = Vec((1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)) + O(x^n)) \\ Iain Fox, Feb 01 2018

CROSSREFS

Cf. A212959.

Sequence in context: A009860 A294249 A138105 * A002442 A301253 A301195

Adjacent sequences:  A213395 A213396 A213397 * A213399 A213400 A213401

KEYWORD

nonn,easy

AUTHOR

Clark Kimberling, Jun 12 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 23 17:32 EDT 2019. Contains 328373 sequences. (Running on oeis4.)