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.
%I A291896 #28 Mar 11 2022 08:00:58 %S A291896 1,1,1,2,3,5,9,14,24,40,67,112,186,312,520,868,1449,2417,4034,6730, %T A291896 11229,18735,31254,52143,86989,145119,242096,403871,673751,1123964, %U A291896 1875014,3127926,5218034,8704769,14521354,24224601,40411595,67414781,112461579,187608762 %N A291896 Number of 1-dimensional sandpiles with n grains piling up against the wall. %C A291896 Number of compositions of n where the first part is 1 and the absolute difference between consecutive parts is <=1 (smooth compositions). %H A291896 Seiichi Manyama, <a href="/A291896/b291896.txt">Table of n, a(n) for n = 0..4501</a> %e A291896 The a(6)=9 smooth compositions of 6 are: %e A291896 : %e A291896 : oooooo| %e A291896 : %e A291896 : o| %e A291896 : ooooo| %e A291896 : %e A291896 : o | %e A291896 : ooooo| %e A291896 : %e A291896 : o | %e A291896 : ooooo| %e A291896 : %e A291896 : o | %e A291896 : ooooo| %e A291896 : %e A291896 : oo| %e A291896 : oooo| %e A291896 : %e A291896 : o o| %e A291896 : oooo| %e A291896 : %e A291896 : oo | %e A291896 : oooo| %e A291896 : %e A291896 : o| %e A291896 : oo| %e A291896 : ooo| %p A291896 b:= proc(n, i) option remember; `if`(n=0, 1, %p A291896 add(b(n-j, j), j=max(1, i-1)..min(i+1, n))) %p A291896 end: %p A291896 a:= n-> b(n, 0): %p A291896 seq(a(n), n=0..50); # _Alois P. Heinz_, Sep 05 2017 %t A291896 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_ *) %o A291896 (Python) %o A291896 from sympy.core.cache import cacheit %o A291896 @cacheit %o A291896 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)) %o A291896 def a(n): return b(n, 0) %o A291896 print([a(n) for n in range(51)]) # _Indranil Ghosh_, Sep 06 2017, after Maple code %Y A291896 Cf. A186085, A291895. %K A291896 nonn %O A291896 0,4 %A A291896 _Seiichi Manyama_, Sep 05 2017