OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
G.f.: x+x^2 = x*((1+x+x^2) - x^2)/(1+x+x^2) + x^2*((1+x+x^2)^2 - x^4)/(1+x+x^2)^2 + x^3*((1+x+x^2)^3 - x^6)/(1+x+x^2)^5 + x^4*((1+x+x^2)^4 - x^8)/(1+x+x^2)^6 + x^5*((1+x+x^2)^5 - x^10)/(1+x+x^2)^7 + x^6*((1+x+x^2)^6 - x^12)/(1+x+x^2)^9 + x^7*((1+x+x^2)^7 - x^14)/(1+x+x^2)^10 + x^8*((1+x+x^2)^8 - x^16)/(1+x+x^2)^11 + x^9*((1+x+x^2)^9 - x^18)/(1+x+x^2)^15 +...+ x^n*((1+x+x^2)^n - x^(2*n))/(1+x+x^2)^a(n) +...
MATHEMATICA
Table[n+Floor[Log[3, n]]+IntegerExponent[n!, 3], {n, 90}] (* Harvey P. Dale, Oct 10 2012 *)
PROG
(PARI) {a(n)=if(n<1, 0, n + floor(log(n+1/2)/log(3)) + valuation(n!, 3))}
(PARI) {a(n)=if(n<1, 0, if(n==1, 1, polcoeff(sum(m=1, n+1, x^m*((1+x+x^2)^m-x^(2*m))/(1+x+x^2 +x^2*O(x^n))^if(m>=n, 1, a(m)))+x^(n+1), n+1)))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jul 19 2011
STATUS
approved