OFFSET
0,2
COMMENTS
LINKS
N. Heninger, E. M. Rains and N. J. A. Sloane, On the Integrality of n-th Roots of Generating Functions, J. Combinatorial Theory, Series A, 113 (2006), 1732-1745.
EXAMPLE
MATHEMATICA
a[n_] := a[n] = Module[{A, P, t}, A = 1+3x; P = Table[0, 3(n+1)]; P[[1]] = 1; P[[3]] = 2; For[j = 2, j <= n, j++, For[k = 2, k <= 3(n+1), k++, If[P[[k]] == 0, t = Coefficient[(A + k x^j + x^2 O[x]^j)^(1/3), x, j]; If[Denominator[t] == 1, P[[k]] = j+1; A = A + k*x^j; Break[]]]]]; Coefficient[A + x O[x]^n, x, n]];
Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 66}] (* Jean-François Alcover, Jul 25 2018, translated from PARI *)
PROG
(PARI) {a(n)=local(A=1+3*x, P=vector(3*(n+1))); P[1]=1; P[3]=2; for(j=2, n, for(k=2, 3*(n+1), if(P[k]==0, t=polcoeff((A+k*x^j+x^2*O(x^j))^(1/3), j); if(denominator(t)==1, P[k]=j+1; A=A+k*x^j; break)))); return(polcoeff(A+x*O(x^n), n))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Apr 25 2003; revised May 01 2005
STATUS
approved