%I #83 Jun 25 2023 20:06:50
%S 1,1,1,1,2,3,5,8,13,22,36,60,100,166,277,461,769,1282,2137,3565,5945,
%T 9916,16540,27589,46022,76769,128062,213628,356366,594483,991706,
%U 1654352,2759777,4603843,7680116,12811951,21372882,35654237,59478406,99221923,165522118,276124217,460630839
%N Number of 1-dimensional sandpiles with n grains.
%C Number of compositions of n where the first and the last parts are 1 and the absolute difference between consecutive parts is <=1 (smooth compositions).
%C Such a composition [c1,c2,c3,...] corresponds to a sandpile with c1(=1) grains in the first positions, c2 in the second, and so on. Assuming the critical slope is 1 (for the pile to be stable) we obtain the conditions on the compositions.
%C With the additional requirement of unimodality one gets A001522. [_Joerg Arndt_, Dec 09 2012]
%C Dropping the requirement that the first and last parts are 1 gives A034297. Restriction to weakly increasing (or decreasing) sums gives A034296. [_Joerg Arndt_, Jun 02 2013]
%C Also the number of compositions of n with first part 1, up-steps of at most 1, and no two consecutive up-steps. The sandpiles are recovered by shifting the rows above the bottom row to the left by one position relative to the next lower row. [_Joerg Arndt_, Mar 30 2014]
%C Also fountains of coins (cf. A005169) with no consecutive up-steps. Shift the top rows in the previous comment by half a position. [_Joerg Arndt_, Mar 30 2014]
%H Seiichi Manyama, <a href="/A186085/b186085.txt">Table of n, a(n) for n = 0..4502</a> (terms 0..1000 from Alois P. Heinz)
%F G.f.: 1 + x/(1-x - x^3*B(x)) where B(x) equals the g.f. of the antidiagonal sums of triangle A186084 [_Paul D. Hanna_].
%F G.f.: 1 + x/(1-x - x^3/(1-x^2 - x^5/(1-x^3 - x^7/(1-x^4 - x^9/(1 -...))))) (continued fraction). [_Paul D. Hanna_].
%F G.f.: 1/(1 - x/(1-x^3/(1-x^2/(1 - x^3/(1-x^7/(1-x^4/(1 - x^5/(1-x^11/(1-x^6/(1 -...)))))))))) (continued fraction). [_Paul D. Hanna_].
%F The g.f. T(x,y) of triangle A186084 satisfies: T(x,y) = 1/(1 - x*y - x^3*y^2*T(x,x*y)); therefore, the g.f. of this sequence is A(x) = 1 + x*T(x,1). [_Paul D. Hanna_]
%F a(n) ~ c/r^n where r = 0.5994477646147968266874606710272382... and c = 0.213259838728143595595398989847345... [_Paul D. Hanna_]
%F G.f.: 1 + 1/Q(0), where Q(k)= 1/x^(k+1) - 1 - 1/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, May 07 2013
%F G.f.: G(1), where G(k) = 1 + x^k/( 1 - x^k * G(k+1) ) (continued fraction). [_Joerg Arndt_, Jun 29 2013]
%F a(n) = Sum_{j=1..n} A129181(n-j,j-1) for n>=1. - _Alois P. Heinz_, Jun 25 2023
%e The a(7)=8 smooth compositions of 7 are:
%e : 1: [ 1 1 1 1 1 1 1 ] (composition)
%e :
%e : ooooooo (rendering of sandpile)
%e :
%e : 2: [ 1 1 1 1 2 1 ]
%e :
%e : o
%e : oooooo
%e :
%e : 3: [ 1 1 1 2 1 1 ]
%e :
%e : o
%e : oooooo
%e :
%e : 4: [ 1 1 2 1 1 1 ]
%e :
%e : o
%e : oooooo
%e :
%e : 5: [ 1 1 2 2 1 ]
%e :
%e : oo
%e : ooooo
%e :
%e : 6: [ 1 2 1 1 1 1 ]
%e :
%e : o
%e : oooooo
%e :
%e : 7: [ 1 2 1 2 1 ]
%e :
%e : o o
%e : ooooo
%e :
%e : 8: [ 1 2 2 1 1 ]
%e :
%e : oo
%e : ooooo
%p b:= proc(n, i) option remember; `if`(n=0, `if`(i=1, 1, 0),
%p `if`(n<0 or i<1, 0, add(b(n-i, i+j), j=-1..1)))
%p end:
%p a:= n-> `if`(n=0, 1, b(n-1, 1)):
%p seq(a(n), n=0..50); # _Alois P. Heinz_, Jun 11 2013
%t b[n_, i_] := b[n, i] = If[n == 0, If[i == 1, 1, 0], If[n<0 || i<1, 0, Sum[b[n-i, i+j], {j, -1, 1}]]]; a[n_] := If[n == 0, 1, b[n-1, 1]]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Feb 03 2014, after _Alois P. Heinz_ *)
%o (PARI) {a(n)=local(Txy=1+x*y); for(i=1, n, Txy=1/(1-x*y-x^3*y^2*subst(Txy, y, x*y+x*O(x^n)))); polcoeff(subst(1+x*Txy, y, 1), n, x)} /* _Paul D. Hanna_ */
%o (PARI) /* continued fraction for terms up to 460630839: */
%o Vec(1/ (1-x/ (1-x^3/ (1-x^2/ (1-x^3/ (1-x^7/ (1-x^4/ (1-x^5/ (1-x^11/ (1-x^6/(1-x*O(x^0) ))))))))))) /* _Paul D. Hanna_ */
%o (PARI) N = 66; x = 'x + O('x^N);
%o Q(k) = if(k>N, 1, 1/x^(k+1) - 1 - 1/Q(k+1) );
%o gf = 1 + 1/Q(0);
%o Vec(gf) /* _Joerg Arndt_, May 07 2013 */
%Y Cf. A186084 (sandpiles by base length).
%Y Cf. A005169 (compositions of n with c(1)=1 and c(i+1)<=c(i)+1).
%Y Cf. A186505 (antidiagonal sums of triangle A186084).
%Y Cf. A001522, A001523, A001524.
%Y Cf. A129181.
%K nonn,nice
%O 0,5
%A _Joerg Arndt_, Feb 12 2011