OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: Sum_{k>=1} x^k/(1 - 3 * x^k)^2.
MATHEMATICA
a[n_] := DivisorSum[n, 3^(#-1)*# &]; Array[a, 27] (* Amiram Eldar, Aug 27 2023 *)
PROG
(PARI) a(n) = sumdiv(n, d, d*3^(d-1));
(PARI) my(N=30, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-3*x^k)^2))
(Magma)
A359018:= func< n | (&+[3^(d-1)*d: d in Divisors(n)]) >;
[A359018(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
(SageMath)
def A359018(n): return sum(3^(k-1)*k for k in (1..n) if (k).divides(n))
[A359018(n) for n in range(1, 41)] # G. C. Greubel, Jun 26 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Dec 19 2022
STATUS
approved