Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #9 Sep 08 2022 08:45:53
%S 1,4,11,42,177,817,3981,20164,105027,558915,3025287,16603039,92169795,
%T 516644985,2920055107,16622691454,95220681081,548477688005,
%U 3174801937437,18457766735525,107734640321681,631075890235811
%N a(n+1) = m + Sum_{j=0..n} (a(j)*a(n-j) + k) for n>=1, with a(0)=1, a(1)=4, k=1 and m=1.
%H G. C. Greubel, <a href="/A176645/b176645.txt">Table of n, a(n) for n = 0..1000</a>
%F G.f.: (1 - sqrt(1 - 4*z*(a(0) - z*a(0)^2 + z*a(1) + (k+m)*z^2/(1-z) + k*z^2/(1-z)^2)) )/(2*z) with a(0) = 1, a(1) = 4, k=1, m=1.
%F (n+1)*a(n) - (7*n-2)*a(n-1) + 3*(n+1)*a(n-2) + (11*n-34)*a(n-3) - 12*(n-4)*a(n-4) + 4*(n-5)*a(n-5) = 0. - _R. J. Mathar_, Mar 01 2016
%F From _G. C. Greubel_, Jul 02 2021: (Start)
%F a(n) = m + k*n + Sum_{j=0..n-1} a(j)*a(n-j-1), with a(0)=1, a(1)=4, k=1 and m=1.
%F G.f.: (1-x -sqrt(1 -6*x -3*x^2 +8*x^3 -4*x^4))/(2*x*(1-x)). (End)
%e a(2) = 2*1*4 + 2 + 1 = 11.
%e a(3) = 2*1*11 + 2 + 4^2 + 1 + 1 = 42.
%e a(4) = 2*1*42 + 2 + 2*4*11 + 2 + 1 = 177.
%p # First program
%p l:=1: : k := 1 : m:=4: a(0):=1 : a(1):=m:
%p for n from 1 to 51 do a(n+1):=sum(a(p)*a(n-p)+k, p=0..n) +l : od :
%p seq(a(n), n=0..40);
%p # Second program
%p n:= 40;
%p S:= series((1-x -sqrt(-4*x^4 +8*x^3 -3*x^2 -6*x +1))/(2*x*(1-x)), x, n+1);
%p seq(coeff(S, x, j), j = 0..n); # modified by _G. C. Greubel_, Jul 02 2021
%t a[n_,k_,m_]:= a[n,k,m]= If[n<2, 4^n, m +k*n +Sum[a[j,k,m]*a[n-j-1,k,m], {j,0,n-1}]];
%t Table[a[n, 1, 1], {n, 0, 40}] (* _G. C. Greubel_, Jul 02 2021 *)
%o (Magma)
%o R<x>:=PowerSeriesRing(Rationals(), 40);
%o Coefficients(R!( (1-x -Sqrt(1 -6*x -3*x^2 +8*x^3 -4*x^4))/(2*x*(1-x)) )); // _G. C. Greubel_, Jul 02 2021
%o (Sage)
%o @CachedFunction
%o def a(n,k,m): return 4^n if (n<2) else m + k*n + sum(a(j,k,m)*a(n-j-1,k,m) for j in (0..n-1))
%o [a(n,1,1) for n in (0..40)] # _G. C. Greubel_, Jul 02 2021
%Y Cf. A176612.
%K easy,nonn
%O 0,2
%A _Richard Choulet_, Apr 22 2010