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.
%I A363913 #19 Jun 26 2024 04:21:58 %S A363913 1,3,12,30,93,246,768,2190,6654,19713,59304,177150,532290,1594326, %T A363913 4785168,14349180,43053375,129140166,387440940,1162261470,3486843786, %U A363913 10460355420,31381236768,94143178830,282430075332,847288609689,2541867422664,7625597504700,22876797240210 %N A363913 a(n) = Sum_{k=0..n} divides(k, n) * 3^k, where divides(k, n) = 1 if k divides n, otherwise 0. %H A363913 G. C. Greubel, <a href="/A363913/b363913.txt">Table of n, a(n) for n = 0..1000</a> %F A363913 a(n) = Sum_{j=0..n} A113704(j, n) * m^j for m = 3; for other cases see the crossreferences. %F A363913 a(n) = 3*A034730(n), n>=1. - _R. J. Mathar_, Jul 04 2023 %p A363913 divides := (k, n) -> ifelse(k = n or (k > 0 and irem(n, k) = 0), 1, 0): %p A363913 a := n -> local j; add(divides(j, n) * 3^j, j = 0 ..n): seq(a(n), n = 0..28); %t A363913 A363913[n_]:= If[n==0, 1, 3*DivisorSum[n, 3^(#-1) &]]; %t A363913 Table[A363913[n], {n,0,40}] (* _G. C. Greubel_, Jun 26 2024 *) %o A363913 (SageMath) %o A363913 def a(n): return sum(3^k * k.divides(n) for k in srange(n+1)) %o A363913 print([a(n) for n in range(29)]) %o A363913 (Python) %o A363913 from sympy import divisors %o A363913 def A363913(n): return sum(3**k for k in divisors(n,generator=True)) if n else 1 # _Chai Wah Wu_, Jun 28 2023 %o A363913 (Magma) %o A363913 A363913:= func< n | n eq 0 select 1 else 3*(&+[3^(d-1): d in Divisors(n)]) >; %o A363913 [A363913(n): n in [0..40]]; // _G. C. Greubel_, Jun 26 2024 %Y A363913 Cf. A000007 (m = 0), A000005 (m = 1), A055895 (m = 2), this sequence (m = 3). %Y A363913 Cf. A113704, A363733, A363734, A363735, A363421. %K A363913 nonn %O A363913 0,2 %A A363913 _Peter Luschny_, Jun 28 2023