OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{j=0..n} A113704(j, n) * m^j for m = 3; for other cases see the crossreferences.
a(n) = 3*A034730(n), n>=1. - R. J. Mathar, Jul 04 2023
MAPLE
divides := (k, n) -> ifelse(k = n or (k > 0 and irem(n, k) = 0), 1, 0):
a := n -> local j; add(divides(j, n) * 3^j, j = 0 ..n): seq(a(n), n = 0..28);
MATHEMATICA
A363913[n_]:= If[n==0, 1, 3*DivisorSum[n, 3^(#-1) &]];
Table[A363913[n], {n, 0, 40}] (* G. C. Greubel, Jun 26 2024 *)
PROG
(SageMath)
def a(n): return sum(3^k * k.divides(n) for k in srange(n+1))
print([a(n) for n in range(29)])
(Python)
from sympy import divisors
def A363913(n): return sum(3**k for k in divisors(n, generator=True)) if n else 1 # Chai Wah Wu, Jun 28 2023
(Magma)
A363913:= func< n | n eq 0 select 1 else 3*(&+[3^(d-1): d in Divisors(n)]) >;
[A363913(n): n in [0..40]]; // G. C. Greubel, Jun 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jun 28 2023
STATUS
approved