OFFSET
1,3
COMMENTS
FORMULA
MAPLE
A227506 := proc(n) local k, T; T := proc(n, k) option remember; if n=1 then return(1) fi; if k<n then return(0) fi; T(n, k-1)+T(n-1, k-1)+T(n-1, k) end; add(T(2*k-1, n), k = 1..iquo(n+1, 2)) end: seq(A227506(n), n = 1..24); # Peter Luschny, Jul 17 2013
A227506 := proc(n): if type(n, odd) then A010683(n-1) else A010683(n-1) - A001003(n-1) fi: end: A010683 := proc(n): if n = 0 then 1 else (2/n)*add(binomial(n, k)* binomial(n+k+1, k-1), k=1..n) fi: end: A001003 := proc(n): if n = 0 then 1 else add(binomial(n, j)*binomial(n+j, n-1), j=0..n)/(2*n) fi: end: seq(A227506(n), n=1..24);
MATHEMATICA
T[n_, k_] := T[n, k] = Which[n == 1, 1, k < n, 0, True, T[n, k - 1] + T[n - 1, k - 1] + T[n - 1, k]];
a[n_] := Sum[T[2 k - 1, n], {k, 1, (n + 1)/2}];
Array[a, 24] (* Jean-François Alcover, Jul 11 2019, from Sage *)
PROG
(Sage)
def A227506(n):
@CachedFunction
def T(n, k):
if n==1: return 1
if k <n: return 0
return T(n, k-1)+T(n-1, k-1)+T(n-1, k)
return add(T(2*k-1, n) for k in (1..(n+1)//2))
[A227506(n) for n in (1..24)] # Peter Luschny, Jul 16 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Johannes W. Meijer, Jul 15 2013
STATUS
approved