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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A291896 Number of 1-dimensional sand piles with n grains piling up against the wall. 5
1, 1, 1, 2, 3, 5, 9, 14, 24, 40, 67, 112, 186, 312, 520, 868, 1449, 2417, 4034, 6730, 11229, 18735, 31254, 52143, 86989, 145119, 242096, 403871, 673751, 1123964, 1875014, 3127926, 5218034, 8704769, 14521354, 24224601, 40411595, 67414781, 112461579, 187608762 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Number of compositions of n where the first part is 1 and the absolute difference between consecutive parts is <=1 (smooth compositions).

LINKS

Seiichi Manyama, Table of n, a(n) for n = 0..4501

EXAMPLE

The a(6)=9 smooth compositions of 6 are:

:

: oooooo|

:

:     o|

: ooooo|

:

:    o |

: ooooo|

:

:   o  |

: ooooo|

:

:  o   |

: ooooo|

:

:   oo|

: oooo|

:

:  o o|

: oooo|

:

:  oo |

: oooo|

:

:   o|

:  oo|

: ooo|

MAPLE

b:= proc(n, i) option remember; `if`(n=0, 1,

      add(b(n-j, j), j=max(1, i-1)..min(i+1, n)))

    end:

a:= n-> b(n, 0):

seq(a(n), n=0..50);  # Alois P. Heinz, Sep 05 2017

MATHEMATICA

b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, j], {j, Max[1, i-1], Min[i+1, n]}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 50}] (* Jean-Fran├žois Alcover, May 29 2019, after Alois P. Heinz *)

PROG

(Python)

from sympy.core.cache import cacheit

@cacheit

def b(n, i): return 1 if n==0 else sum([b(n - j, j) for j in range(max(1, i - 1), min(i + 1, n) + 1)])

def a(n): return b(n, 0)

print(map(a, range(51))) # Indranil Ghosh, Sep 06 2017, after Maple code

CROSSREFS

Cf. A186085, A291895.

Sequence in context: A026746 A004699 A245800 * A018155 A227375 A032089

Adjacent sequences:  A291893 A291894 A291895 * A291897 A291898 A291899

KEYWORD

nonn

AUTHOR

Seiichi Manyama, Sep 05 2017

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