login
G.f. satisfies x = A(x)*(1+A(x))/(1-A(x)-(A(x))^2).
4

%I #20 Oct 20 2023 01:46:52

%S 1,0,-1,1,1,-4,3,8,-23,10,67,-153,9,586,-1081,-439,5249,-7734,-7941,

%T 47501,-53791,-105314,430119,-343044,-1249799,3866556,-1730017,

%U -13996097,34243897,-1947204,-150962373,296101864,121857185

%N G.f. satisfies x = A(x)*(1+A(x))/(1-A(x)-(A(x))^2).

%C Row sums of triangle A202327. - _Peter Luschny_, Apr 26 2017

%H G. C. Greubel, <a href="/A108624/b108624.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = (1/n)*Sum_{k=1..n} ( k * Sum_{j=0..n} (-1)^(k+j)*binomial(j, 2*j-n-k)*binomial(n,j) ). - _Vladimir Kruchinin_, May 19 2012

%F G.f.: (-1 + x + sqrt(1+2*x+5*x^2))/(2*(1+x)). - _G. C. Greubel_, Oct 20 2023

%t a[n_]:= Sum[k Sum[(-1)^(j-k) Binomial[j, 2j-n-k] Binomial[n, j], {j, 0, n}], {k, 1, n}]/n;

%t Array[a, 33] (* _Jean-François Alcover_, Jun 13 2019, after _Vladimir Kruchinin_ *)

%t Rest@CoefficientList[Series[(-1+x+Sqrt[1+2*x+5*x^2])/(2*(1+x)), {x,0, 41}], x] (* _G. C. Greubel_, Oct 20 2023 *)

%o (Julia)

%o function A108624_list(len::Int)

%o len <= 0 && return BigInt[]

%o T = zeros(BigInt, len, len); T[1,1] = 1

%o S = Array(BigInt, len); S[1] = 1

%o for n in 2:len

%o T[n,n] = 1

%o for k in 1:n-1

%o T[n,k] = (k > 1 ? T[n-1,k-1] : 0) - T[n-1,k] - T[n-1,k+1]

%o end

%o S[n] = sum(T[n,k] for k in 1:n)

%o end

%o S end

%o println(A108624_list(33)) # _Peter Luschny_, Apr 27 2017

%o (Magma)

%o R<x>:=PowerSeriesRing(Rationals(), 41);

%o Coefficients(R!( (-1+x+Sqrt(1+2*x+5*x^2))/(2*(1+x)) )); // _G. C. Greubel_, Oct 20 2023

%o (SageMath)

%o def A108624_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P( (-1+x+sqrt(1+2*x+5*x^2))/(2*(1+x))).list()

%o a=A108624_list(41); a[1:] # _G. C. Greubel_, Oct 20 2023

%Y Cf. A039980, A202327.

%Y Except for signs, same as A108623.

%K sign

%O 1,6

%A _Christian G. Bower_, Jun 12 2005