login
Sequence defined by the recurrence formula a(n+1)=sum(a(p)*a(n-p)+k,p=0..n)+l for n>=1, with here a(0)=1, a(1)=1, k=0 and l=-1.
2

%I #16 Jun 20 2023 22:28:03

%S 1,1,1,2,5,14,41,123,375,1158,3615,11393,36209,115940,373709,1211740,

%T 3949969,12937612,42558745,140547051,465799527,1548766044,5164917003,

%U 17271369744,57900615135,194558333460,655168354935,2210681734671

%N Sequence defined by the recurrence formula a(n+1)=sum(a(p)*a(n-p)+k,p=0..n)+l for n>=1, with here a(0)=1, a(1)=1, k=0 and l=-1.

%C a(n) is the number of Motzkin paths of length n-1 in which the (1,0)-steps at odd levels come in 2 colors. Example: a(5)=14 because, denoting U=(1,1), H=(1,0), and D=(1,-1), we have 2 paths of shape HUHD, 2 paths of shape UHDH, 4 paths of shape UHHD, and 1 path of each of the shapes HHHH, HHUD, HUDH, UDHH, UDUD, and UUDD. - _Emeric Deutsch_, May 02 2011

%H Petr Gregor, Torsten Mütze, and Namrata, <a href="https://arxiv.org/abs/2306.08420">Combinatorial generation via permutation languages. VI. Binary trees</a>, arXiv:2306.08420 [cs.DM], 2023.

%F G.f.: (1-sqrt(1-4*z*(a(0)-z*a(0)^2+z*a(1)+(k+j)*z^2/(1-z)+k*z^2/(1-z)^2)))/(2*z) (k=0, j=-1).

%F G.f. G=G(z) satisfies the equation z^2*(1-z)*G^2-(1-z)*(1-2*z)*G+1-2*z =0. - _Emeric Deutsch_, May 02 2011

%F Conjecture: (n+1)*a(n) +2*(-3*n+1)*a(n-1) +(9*n-13)*a(n-2) -4*a(n-3) +4*(-n+4)*a(n-4)=0. - _R. J. Mathar_, Mar 01 2016

%e a(2)=2*1*1-1=1. a(3)=2*1*1+1^1-1=2. a(4)=2*1*2+2*1*1-1=5.

%p l:=-1: : k := 0 :m :=1:d(0):=1:d(1):=m: for n from 1 to 30 do d(n+1):=sum(d(p)*d(n-p)+k,p=0..n)+l:od :

%p taylor((1-sqrt(1-4*z*(d(0)-z*d(0)^2+z*m+(k+l)*z^2/(1-z)+k*z^2/(1-z)^2)))/(2*z),z=0,30);seq(d(n),n=0..30);

%Y Cf. A176675.

%K nonn

%O 0,4

%A _Richard Choulet_, Apr 23 2010