OFFSET
0,5
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
MATHEMATICA
b[0] = 1; b[1] = 0; b[n_] := b[n] = (n-1)*(2*b[n-1] + 3*b[n-2])/(n+1);
a[0] = 1; a[n_] := (b[n] + Sum[EulerPhi[n/d]*Coefficient[(1 + x + x^2)^d, x, d], {d, Most @ Divisors[n]}])/n;
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jul 03 2018, after Andrew Howroyd *)
PROG
(PARI) \\ here b(n) is A005043.
b(n) = {polcoeff(serreverse((x - x^3) / (1 + x^3) + x * O(x*x^n)), n+1)}
a(n) = {if(n<1, n==0, (b(n) + sumdiv(n, d, if(d<n, eulerphi(n/d) * polcoeff((1 + x + x^2)^d, d))))/n)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Howroyd, Nov 16 2017
STATUS
approved