OFFSET
0,3
COMMENTS
Appears to be related to mod 3 modular forms: see MathOverflow link.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
P. Monsky, How to explain these remarkable empirical observations about mod 3 modular forms of levels 1 and 5, MathOverflow.
FORMULA
G.f. g(x) satisfies g(x) = (x+3*x^2)/(1-x^3) + 9*(1+x+x^2)*g(x^3).
The base-9 representation of a(n) is obtained from the base-3 representation of n by replacing each digit 2 with digit 3. - Max Alekseyev, May 02 2024
EXAMPLE
G.f. = x + 3*x^2 + 9*x^3 + 10*x^4 + 12*x^5 + 27*x^6 + 28*x^7 + 30*x^8 + ... - Michael Somos, Sep 20 2018
MAPLE
f:= proc(n) option remember; local t;
t:= n mod 3;
if t = 0 then 9*procname(n/3) elif t=1 then 1+9*procname((n-1)/3) else 3 + 9*procname((n-2)/3) fi
end proc:
f(0):= 0:
map(f, [$0..100]);
MATHEMATICA
a[ n_] := If[ n < 1, 0, 9 a[Quotient[n, 3]] + Binomial[Mod[n, 3] + 1, 2]]; (* Michael Somos, Sep 20 2018 *)
PROG
(PARI) {a(n) = if( n<1, 0 , 9*a(n\3) + binomial(n%3 + 1, 2))}; /* Michael Somos, Sep 20 2018 */
(PARI) { a319497(n) = fromdigits(apply(x->if(x==2, 3, x), digits(n, 3)), 9); } /* Max Alekseyev, May 02 2024 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 20 2018
STATUS
approved