%I #111 Sep 17 2024 13:29:24
%S 1,1,5,29,185,1257,8925,65445,491825,3768209,29324405,231153133,
%T 1841801065,14810069497,120029657805,979470140661,8040831465825,
%U 66361595715105,550284185213925,4582462506008253,38306388126997785,321327658068506121,2703925940081270205
%N Number of different lattice paths running from (0,0) to (n,0) using steps from S = {(k,k) or (k,-k): k positive integer} that never go below the x-axis.
%C If y = x*A(x) then 4*y^2 - (1 + 3*x)*y + x = 0 and x = y*(1 - 4*y) / (1 - 3*y). - _Michael Somos_, Sep 28 2003
%C a(n) = A059450(n, n). - _Michael Somos_, Mar 06 2004
%C The Hankel transform of this sequence is 4^binomial(n+1,2). - _Philippe Deléham_, Oct 29 2007
%C a(n) is the number of Schroder paths of semilength n in which there are no (2,0)-steps at level 0 and at a higher level they come in 3 colors. Example: a(2)=5 because we have UDUD, UUDD, UBD, UGD, and URD, where U=(1,1), D=(1,-1), while B, G, and R are, respectively, blue, green, and red (2,0)-steps. - _Emeric Deutsch_, May 02 2011
%C Shifts left when INVERT transform applied four times. - _Benedict W. J. Irwin_, Feb 02 2016
%H Vincenzo Librandi, <a href="/A059231/b059231.txt">Table of n, a(n) for n = 0..1000</a>
%H Paul Barry, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL9/Barry/barry91.html">On Integer-Sequence-Based Constructions of Generalized Pascal Triangles</a>, Journal of Integer Sequences, Vol. 9 (2006), Article 06.2.4.
%H Paul Barry and Aoife Hennessy, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Barry2/barry126.html">A Note on Narayana Triangles and Related Polynomials, Riordan Arrays, and MIMO Capacity Calculations</a>, J. Int. Seq. 14 (2011), Article 11.3.8.
%H Paul Barry and Aoife Hennessy, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL15/Barry2/barry190r.html">Generalized Narayana Polynomials, Riordan Arrays, and Lattice Paths</a>, Journal of Integer Sequences, Vol. 15 (2012), Article 12.4.8.
%H Zhi Chen and Hao Pan, <a href="https://arxiv.org/abs/1608.02448">Identities involving weighted Catalan, Schroder and Motzkin paths</a>, arXiv:1608.02448 [math.CO], 2016. See eq. (1.13), a=1, b=4.
%H Curtis Coker, <a href="http://dx.doi.org/10.1016/S0012-365X(03)00037-2">Enumerating a class of lattice paths</a>, Discrete Math., 271 (2003), 13-28 (the sequence d_n).
%H Curtis Coker, <a href="http://dx.doi.org/10.1016/j.disc.2003.12.008">A family of eigensequences</a>, Discrete Math. 282 (2004), 249-250.
%H Aoife Hennessy, <a href="http://repository.wit.ie/1693/1/AoifeThesis.pdf">A Study of Riordan Arrays with Applications to Continued Fractions, Orthogonal Polynomials and Lattice Paths</a>, Ph. D. Thesis, Waterford Institute of Technology, Oct. 2011.
%H Joseph P. S. Kung and Anna de Mier, <a href="http://dx.doi.org/10.1016/j.jcta.2012.08.010">Catalan lattice paths with rook, bishop and spider steps</a>, J. Comb. Theor., Series A (2013) Vol. 120, Issue 2, 379-389.
%H Gregory J. Morrow, <a href="https://doi.org/10.1016/j.spa.2014.12.005">Laws relating runs and steps in gambler’s ruin</a>, Stochastic Proc. Appl. (2024) Vol. 125, Issue 5, 2010-2025.
%H Greg Morrow, <a href="https://faculty.uccs.edu/gmorrow/wp-content/uploads/sites/19/2024/08/Prob_Distrns__Int_Seqs_related_to_Rook_Paths_Aug_9_2024.pdf">Some probability distributions and integer sequences related to rook paths</a>, Univ. Colorado Springs (2024). See pp. 1, 4, 15, 22.
%H Michael Z. Spivey and Laura L. Steil, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL9/Spivey/spivey7.html"> The k-Binomial Transforms and the Hankel Transform</a>, J. Integ. Seqs. Vol. 9 (2006), #06.1.1.
%H Wen-jin Woan, <a href="https://zbmath.org/?q=an:01735667">Diagonal lattice paths</a>, Congr. Numer. 151 (2001) 173-178
%F a(n) = Sum_{k=0..n} 4^k*N(n, k) where N(n, k) = (1/n)*binomial(n, k)*binomial(n, k+1) are the Narayana numbers (A001263). - _Benoit Cloitre_, May 10 2003
%F a(n) = 3^n/2*LegendreP(n, -1, 5/3). - _Vladeta Jovovic_, Sep 17 2003
%F G.f.: (1 + 3*x - sqrt(1 - 10*x + 9*x^2)) / (8*x) = 2 / (1 + 3*x + sqrt(1 - 10*x + 9*x^2)). - _Michael Somos_, Sep 28 2003
%F a(n) = Sum_{k=0..n} A088617(n, k)*4^k*(-3)^(n-k). - _Philippe Deléham_, Jan 21 2004
%F With offset 1: a(1)=1, a(n) = -3*a(n-1) + 4*Sum_{i=1..n-1} a(i)*a(n-i). - _Benoit Cloitre_, Mar 16 2004
%F D-finite with recurrence a(n) = (5(2n-1)a(n-1) - 9(n-2)a(n-2))/(n+1) for n>=2; a(0)=a(1)=1. - _Emeric Deutsch_, Mar 20 2004
%F Moment representation: a(n)=(1/(8*Pi))*Int(x^n*sqrt(-x^2+10x-9)/x,x,1,9)+(3/4)*0^n. - _Paul Barry_, Sep 30 2009
%F a(n) = upper left term in M^n, M = the production matrix:
%F 1, 1
%F 4, 4, 4
%F 1, 1, 1, 1
%F 4, 4, 4, 4, 4
%F 1, 1, 1, 1, 1, 1
%F ... - _Gary W. Adamson_, Jul 08 2011
%F a(n) is the sum of top row terms of Q^(n-1), where Q = the following infinite square production matrix:
%F 1, 4, 0, 0, 0, ...
%F 1, 1, 4, 0, 0, ...
%F 1, 1, 1, 4, 0, ...
%F 1, 1, 1, 1, 4, ...
%F ... - _Gary W. Adamson_, Aug 23 2011
%F G.f.: (1+3*x-sqrt(9*x^2-10*x+1))/(8*x)=(1+3*x -G(0))/(4*x) ; G(k)= 1+x*3-x*4/G(k+1); (continued fraction, 1-step ). - _Sergei N. Gladkovskii_, Jan 05 2012
%F a(n) ~ sqrt(2)*3^(2*n+1)/(8*sqrt(Pi)*n^(3/2)). - _Vaclav Kotesovec_, Oct 11 2012
%F a(n) = A127846(n) for n>0. - _Philippe Deléham_, Apr 03 2013
%F 0 = a(n)*(+81*a(n+1) - 225*a(n+2) + 36*a(n+3)) + a(n+1)*(+45*a(n+1) + 82*a(n+2) - 25*a(n+3)) + a(n+2)*(+5*a(n+2) + a(n+3)) for all n>=0. - _Michael Somos_, Aug 25 2014
%F G.f.: 1/(1 - x/(1 - 4*x/(1 - x/(1 - 4*x/(1 - x/(1 - ...)))))), a continued fraction. - _Ilya Gutkovskiy_, Aug 10 2017
%e a(3) = 29 since the top row of Q^2 = (5, 8, 16, 0, 0, 0, ...), and 5 + 8 + 16 = 29.
%p gf := (1+3*x-sqrt(9*x^2-10*x+1))/(8*x): s := series(gf, x, 100): for i from 0 to 50 do printf(`%d,`,coeff(s, x, i)) od:
%p A059231_list := proc(n) local j, a, w; a := array(0..n); a[0] := 1;
%p for w from 1 to n do a[w] := a[w-1]+4*add(a[j]*a[w-j-1],j=1..w-1) od;
%p convert(a, list) end: A059231_list(20); # _Peter Luschny_, May 19 2011
%t Join[{1},Table[-I 3^n/2LegendreP[n,-1,5/3],{n,40}]] (* _Harvey P. Dale_, Jun 09 2011 *)
%t Table[Hypergeometric2F1[-n, 1 - n, 2, 4], {n, 0, 22}] (* _Arkadiusz Wesolowski_, Aug 13 2012 *)
%o (PARI) {a(n) = if( n<0, 0, polcoeff( (1 + 3*x - sqrt(1 - 10*x + 9*x^2 + x^2 * O(x^n))) / (8*x), n))}; /* _Michael Somos_, Sep 28 2003 */
%o (PARI) {a(n) = if( n<0, 0, n++; polcoeff( serreverse( x * (1 - 4*x) / (1 - 3*x) + x * O(x^n)), n))}; /* _Michael Somos_, Sep 28 2003 */
%o (Sage) # Algorithm of L. Seidel (1877)
%o def A059231_list(n) :
%o D = [0]*(n+2); D[1] = 1
%o R = []; b = False; h = 1
%o for i in range(2*n) :
%o if b :
%o for k in range(1, h, 1) : D[k] += 2*D[k+1]
%o else :
%o for k in range(h, 0, -1) : D[k] += 2*D[k-1]
%o h += 1
%o b = not b
%o if b : R.append(D[1])
%o return R
%o A059231_list(23) # _Peter Luschny_, Oct 19 2012
%Y Cf. A000108, A001003, A007564, A127846.
%Y Row sums of A086873.
%Y Column k=2 of A227578. - _Alois P. Heinz_, Jul 17 2013
%K nonn,easy
%O 0,3
%A _Wenjin Woan_, Jan 20 2001