login
A bisection of A000957.
2

%I #12 Apr 26 2023 18:31:45

%S 1,1,6,57,622,7338,91144,1174281,15548694,210295326,2892818244,

%T 40347919626,569274150156,8110508473252,116518215264492,

%U 1686062250699433,24552388991392230,359526085719652662,5290709340633314596,78201907647506243758,1160507655117628665252,17283862221822154612428,258257655550682547281952

%N A bisection of A000957.

%F a(n) = A000957(2*n+1).

%p b:= proc(n) option remember; `if`(n<3, n*(2-n),

%p ((7*n-12)*b(n-1)+(4*n-6)*b(n-2))/(2*n))

%p end:

%p a:= n-> b(2*n+1):

%p seq(a(n), n=0..25); # _Alois P. Heinz_, Apr 26 2023

%o (PARI)

%o x='x+O('x^100); v=Vec((1-sqrt(1-4*x))/(3-sqrt(1-4*x)));

%o vector(#v\2,n,v[2*n-1]) /* show terms */

%o (Python)

%o from itertools import count, islice

%o def A138414_gen(): # generator of terms

%o yield 1

%o a, c = 0, 1

%o for n in count(1,2):

%o yield (a:=(c:=c*((n<<2)+2)//(n+2))-a>>1)

%o a=(c:=c*((n+1<<2)+2)//(n+3))-a>>1

%o A138414_list = list(islice(A138414_gen(),20)) # _Chai Wah Wu_, Apr 26 2023

%Y Cf. A000957, A138413.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, May 08 2008