OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
Moebius transform is period 6 sequence [ 1, 1, 0, -1, -1, 0, ...].
a(n) is multiplicative with a(2^e) = (3-(-1)^e)/2, a(3^e) = 1, a(p^e) = e+1 if p == 1 (mod 6), a(p^e) = (1+(-1)^e)/2 if p == 5 (mod 6).
a(3n) = a(4n) = a(n). a(6n+5) = 0.
G.f.: Sum_{k>0} x^k/(1-x^k+x^(2k)) = (theta_3(-q^3)^3/theta_3(-q) - 1)/2.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*Pi/(3*sqrt(3)) = 1.209199... (A248897). - Amiram Eldar, Nov 14 2023
MATHEMATICA
f[p_, e_] := If[Mod[p, 6] == 1, e+1, (1+(-1)^e)/2]; f[2, e_] := (3-(-1)^e)/2; f[3, e_] := 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 22 2023 *)
PROG
(PARI) {a(n)=if(n<1, 0, -sumdiv(n, d, (-1)^d*kronecker(-3, d)))}
(PARI) {a(n)=local(A, p, e); if(n<1, 0, A=factor(n); prod(k=1, matsize(A)[1], if(p=A[k, 1], e=A[k, 2]; if(p==2, (3-(-1)^e)/2, if(p==3, 1, if(p%6==1, e+1, !(e%2)))))))}
(PARI) {a(n)=local(A); if(n<0, 0, A=x*O(x^n); polcoeff( (eta(x^2+A)*eta(x^3+A)^6/ eta(x+A)^2/eta(x^6+A)^3-1)/2, n))}
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Michael Somos, Sep 26 2006
STATUS
approved