OFFSET
1,2
COMMENTS
For prime p, a(p) = p; for all n>=1, 0 < a(n) <=n.
LINKS
Paul D. Hanna, Table of n, a(n) for n = 1..185
FORMULA
a(n) = [x^n] F_n(x) where F_n(x) = F_{n-1}(F(x)) such that F(x) = g.f. of A119815 causes {a(n)} to be the least positive integers.
EXAMPLE
Let F(x) = g.f. of A119815 = [1,1,-1,1,1,-11,23,-20,731,-4860,...],
then the coefficient of x^n in the n-th iteration of F(x)
forms [1,2,3,4,5,4,7,8,3,9,11,...], as illustrated by:
F(x) = (1)x + x^2 - x^3 + x^4 + x^5 - 11x^6 + 23x^7 - 20x^8 + 731x^9+..
F(F(x)) = x + (2)x^2 - 2x^4 + 6x^5 - 8x^6 - 50x^7 + 78x^8 + 1688x^9+...
F(F(F(x))) = x + 3x^2 + (3)x^3 - 3x^4 - x^5 + 17x^6 - 81x^7 -370x^8+...
F(F(F(F(x)))) = x + 4x^2 + 8x^3 + (4)x^4 - 12x^5 + 4x^6 + 12x^7 +...
F(F(F(F(F(x))))) = x + 5x^2 + 15x^3 + 25x^4 + (5)x^5 - 55x^6 -33x^7+...
F(F(F(F(F(F(x)))))) = x + 6x^2 + 24x^3 + 66x^4 + 106x^5 + (4)x^6 +...
PROG
(PARI) {a(n)=my(A=vector(n), B, F=x+x^2, G); if(n==1||n==2, n, A[1]=1; A[2]=1; B=A; B[2]=2; for(m=3, n, G=x+x*O(x^n); for(k=1, m, G=subst(F, x, G)); B[m]=polcoeff(G, m, x); A[m]=(m-B[m])\m; F=F+A[m]*x^m); return(B[n]+n*A[n]))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, May 31 2006
STATUS
approved