cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A363913 a(n) = Sum_{k=0..n} divides(k, n) * 3^k, where divides(k, n) = 1 if k divides n, otherwise 0.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Jun 28 2023

Keywords

Crossrefs

Cf. A000007 (m = 0), A000005 (m = 1), A055895 (m = 2), this sequence (m = 3).

Programs

  • 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
  • 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 *)
  • 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
    
  • 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)])
    

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