OFFSET
0,2
COMMENTS
Diagonal sums of A039598.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = A000957(n+3).
a(n) = (1 + Sum_{k=0..n+2} C(k)*(-2)^k)/(8*(-2)^n), where C(n) = Catalan numbers.
D-finite with recurrence: 2*(n+3)*a(n) +(-7*n-9)*a(n-1) +2*(-2*n-3)*a(n-2)=0. - R. J. Mathar, Oct 30 2014 [Verified by Georg Fischer, Apr 27 2023]
MATHEMATICA
CoefficientList[Series[((1-2x-Sqrt[1-4x])/(1+2x+Sqrt[1-4x]))/x^2, {x, 0, 30}], x] (* Harvey P. Dale, Jul 23 2016 *)
Table[(1 + Sum[CatalanNumber[n]*(-2)^k, {k, 0, n+2}])/(8*(-2)^n), {n, 0, 30}] (* G. C. Greubel, Aug 12 2018 *)
PROG
(PARI) x='x+O('x^30); Vec((1-2*x-sqrt(1-4*x))/(x^2*(1+2*x+sqrt(1-4*x)))) \\ G. C. Greubel, Aug 12 2018
(PARI) for(n=0, 30, print1((1 + sum(k=0, n+2, (-2)^k*binomial(2*k, k)/(k+1)))/(8*(-2)^n), ", ")) \\ G. C. Greubel, Aug 12 2018
(Magma) m:=30; R<x>:=PowerSeriesRing(Rationals(), m); Coefficients(R!((1-2*x-Sqrt(1-4*x))/(x^2*(1+2*x+Sqrt(1-4*x))))); // G. C. Greubel, Aug 12 2018
(Python)
from itertools import count, islice
def A104629_gen(): # generator of terms
a, c = 0, 1
for n in count(1):
yield (a:=(c:=c*((n<<2)+2)//(n+2))-a>>1)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Mar 17 2005
STATUS
approved