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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A034928 Triangle of ballot numbers. 2
1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 4, 4, 1, 1, 4, 6, 9, 9, 1, 1, 5, 8, 15, 21, 21, 1, 1, 6, 10, 22, 36, 51, 51, 1, 1, 7, 12, 30, 54, 91, 127, 127, 1, 1, 8, 14, 39, 75, 142, 232, 323, 323, 1, 1, 9, 16, 49, 99, 205, 370, 603, 835, 835, 1, 1, 10, 18, 60, 126, 281, 545 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,8

LINKS

Reinhard Zumkeller, Rows n = 0..125 of triangle, flattened

M. Aigner, Motzkin Numbers, Europ. J. Comb. 19 (1998), 663-675.

FORMULA

a(0, 0)=a(0, 1)=1, a(n, n+1)=a(n, n), a(n, k)=a(n-1, 0)+...+a(n-1, k-2)+a(n-1, k) (n >= 1, 0<=k<=n).

Or, from David W. Wilson: a(n, 0) = 1; a(n, 1) = 1; a(n, 2) = n; a(n, k) = 0 if k > n+1; a(n, k) = a(n-1, k) + a(n, k-1) + a(n-1, k-2) - a(n-1, k-1) otherwise.

EXAMPLE

Triangle begins

1, 1,

1, 1, 1,

1, 1, 2, 2,

1, 1, 3, 4, 4,

1, 1, 4, 6, 9, 9,

1, 1, 5, 8, 15, 21, 21,

1, 1, 6, 10, 22, 36, 51, 51,

1, 1, 7, 12, 30, 54, 91, 127, 127,

1, 1, 8, 14, 39, 75, 142, 232, 323, 323,

1, 1, 9, 16, 49, 99, 205, 370, 603, 835, 835,

...

MATHEMATICA

a[n_, 0] := 1; a[n_, 1] := 1; a[n_, 2] := n; a[n_, k_] := If [k > n + 1, 0, a[n - 1, k] + a[n, k - 1] + a[n - 1, k - 2] - a[n - 1, k - 1]]; Grid[Table[a[n, k], {n, 0, 10}, {k, 0, n + 1}]] (* Replace Grid with Flatten to get the sequence. *) (* L. Edson Jeffery, Aug 02 2014 (after David W. Wilson) *)

PROG

(Haskell)

a034928 n k = a034928_tabf !! n !! k

a034928_row n = a034928_tabf !! n

a034928_tabf = iterate f [1, 1] where

   f us = vs ++ [last vs] where

          vs = zipWith (+) us (0 : scanl (+) 0 us)

-- Reinhard Zumkeller, Sep 20 2014

CROSSREFS

Right-hand edge is A001006.

Cf. A247364 (mirrored).

Sequence in context: A248736 A292508 A237597 * A280267 A161671 A144444

Adjacent sequences:  A034925 A034926 A034927 * A034929 A034930 A034931

KEYWORD

nonn,tabf,easy

AUTHOR

N. J. A. Sloane.

EXTENSIONS

More terms from David W. Wilson.

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 June 19 19:11 EDT 2019. Contains 324222 sequences. (Running on oeis4.)