OFFSET
1,4
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Claudia Rella, Resurgence, Stokes constants, and arithmetic functions in topological string theory, arXiv:2212.10606 [hep-th], 2022. See pages 33 - 35.
FORMULA
a(n) = Sum_{d|n, d==1 (mod 3)} d - Sum_{d|n, d==2 (mod 3)} d.
Multiplicative with a(3^e) = 1, a(p^e) = (p^(e+1)-1)/(p-1) if p == 1 (mod 3) and a(p^e) = ((-p)^(e+1)-1)/(-p-1) if p == 2 (mod 3). - Amiram Eldar, Nov 28 2023
MATHEMATICA
nmax = 66; CoefficientList[Series[Sum[x^k (1 - x^(2 k))/(1 + x^k + x^(2 k))^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
Table[DivisorSum[n, # &, MemberQ[{1}, Mod[#, 3]] &] - DivisorSum[n, # &, MemberQ[{2}, Mod[#, 3]] &], {n, 1, 66}]
f[p_, e_] := If[Mod[p, 3] == 1, (p^(e + 1) - 1)/(p - 1), ((-p)^(e + 1) - 1)/(-p - 1)]; f[3, e_] := 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 28 2023 *)
PROG
(PARI) a(n)={sumdiv(n, d, d*((d+1)%3-1))} \\ Andrew Howroyd, Sep 12 2019
CROSSREFS
KEYWORD
sign,easy,mult
AUTHOR
Ilya Gutkovskiy, Sep 12 2019
STATUS
approved