login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A363913
a(n) = Sum_{k=0..n} divides(k, n) * 3^k, where divides(k, n) = 1 if k divides n, otherwise 0.
2
1, 3, 12, 30, 93, 246, 768, 2190, 6654, 19713, 59304, 177150, 532290, 1594326, 4785168, 14349180, 43053375, 129140166, 387440940, 1162261470, 3486843786, 10460355420, 31381236768, 94143178830, 282430075332, 847288609689, 2541867422664, 7625597504700, 22876797240210
OFFSET
0,2
LINKS
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
Cf. A000007 (m = 0), A000005 (m = 1), A055895 (m = 2), this sequence (m = 3).
Sequence in context: A089143 A073952 A107231 * A352157 A293656 A131936
KEYWORD
nonn
AUTHOR
Peter Luschny, Jun 28 2023
STATUS
approved