OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..650
FORMULA
a(0) = a(1) = 1, a(2) = 0; a(n) = Sum_{k=0..n-3} binomial(n-3,k) * a(k).
MATHEMATICA
nmax = 31; A[_] = 0; Do[A[x_] = 1 + x + x^3 A[x/(1 - x)]/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
a[0] = a[1] = 1; a[2] = 0; a[n_] := a[n] = Sum[Binomial[n - 3, k] a[k], {k, 0, n - 3}]; Table[a[n], {n, 0, 31}]
PROG
(Magma)
function a(n) // a = A346052
if n lt 3 then return Floor((3-n)/2);
else return (&+[Binomial(n-3, j)*a(j): j in [0..n-3]]);
end if; return a;
end function;
[a(n): n in [0..35]]; // G. C. Greubel, Nov 30 2022
(SageMath)
@CachedFunction
def a(n): # a = A346052
if (n<3): return (1, 1, 0)[n]
else: return sum(binomial(n-3, k)*a(k) for k in range(n-2))
[a(n) for n in range(51)] # G. C. Greubel, Nov 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jul 02 2021
STATUS
approved