OFFSET
0,2
COMMENTS
a(n) = 3^A062756(n) * 2^A081603(n), where A062756(n) is the number of 1's and A081603(n) is the number of 2's, in the ternary expansion of n.
More generally, if g.f. of {a(n)} satisfies: A(x) = A(x^d)*(1+Sum_{k=1..d-1} c(k)*x^k), then a(n) = Product_{k=1..d-1} c(k)^digits(n,k,d), where digits(n,k,d) is the number of k's in the d-ary expansion of n and d is any integer > 1. This sequence is a simple example for d=3 with c(1)=3 and c(2)=2.
LINKS
Paul D. Hanna, Table of n, a(n) for n = 0..10000
FORMULA
G.f.: A(x) = Product_{n>=0} (1 + x^(3^n))*(1 + 2*x^(3^n)).
a(n) = a(floor(n/3)) * 3^((n mod 3) mod 2) * 2^floor((n mod 3)/2) with a(0)=1.
PROG
(PARI) {a(n)=local(A=1+x+x*O(x^n)); for(i=1, floor(log(n+1)/log(3))+1, A=subst(A, x, x^3+x*O(x^n))*(1+3*x+2*x^2)); polcoeff(A, n, x)}
(PARI) /* Recurrence: */ {a(n)=if(n==0, 1, a(n\3)*3^((n%3)%2)*2^((n%3)\2))}
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Paul D. Hanna, Jul 11 2006
STATUS
approved