OFFSET
1,3
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 21 - 23.
FORMULA
a(n) = Sum_{d|n, n/d==1 (mod 3)} d - Sum_{d|n, n/d==2 (mod 3)} d.
Multiplicative with a(3^e) = 3^e, a(p^e) = (p^(e+1) - 1)/(p - 1) if p == 1 (mod 3), and (p^(e+1) + (-1)^e)/(p + 1) if p == 2 (mod 3). - Amiram Eldar, Oct 25 2020
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{primes p == 1 (mod 3)} 1/(1 - 1/p^2) * Product_{primes p == 2 (mod 3)} 1/(1 + 1/p^2) = (1/2) * A175646 * (2*Pi^2/27)/A340577 = 0.3906512064... . - Amiram Eldar, Nov 06 2022
MATHEMATICA
nmax = 70; CoefficientList[Series[Sum[k x^k/(1 + x^k + x^(2 k)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
Table[DivisorSum[n, # &, MemberQ[{1}, Mod[n/#, 3]] &] - DivisorSum[n, # &, MemberQ[{2}, Mod[n/#, 3]] &], {n, 1, 70}]
f[p_, e_] := Which[p == 3, p^e, Mod[p, 3] == 1, (p^(e + 1) - 1)/(p - 1), Mod[p, 3] == 2, (p^(e + 1) + (-1)^e)/(p + 1)]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Oct 25 2020 *)
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 1] == 3, 3^f[i, 2], if(f[i, 1]%3 == 1, (f[i, 1]^(f[i, 2]+1) - 1)/(f[i, 1] - 1), (f[i, 1]^(f[i, 2]+1) + (-1)^f[i, 2])/(f[i, 1] + 1)))); } \\ Amiram Eldar, Nov 06 2022
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Ilya Gutkovskiy, Sep 11 2019
STATUS
approved