OFFSET
1,2
FORMULA
G.f.: Sum_{k>=1} k * x^k/(1 - (3 * x)^k).
If p is prime, a(p) = p + 3^(p-1).
MATHEMATICA
a[n_] := DivisorSum[n, # * 3^(n - #) &]; Array[a, 30] (* Amiram Eldar, Aug 11 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, d*3^(n-d));
(PARI) my(N=30, x='x+O('x^N)); Vec(sum(k=1, N, k*x^k/(1-(3*x)^k)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 11 2022
STATUS
approved