login
a(n) = Sum_{d|n} d * 3^(n/d-1).
2

%I #12 Aug 27 2023 17:03:10

%S 1,5,12,37,86,276,736,2261,6597,19870,59060,177780,531454,1595816,

%T 4783272,14353429,43046738,129154113,387420508,1162301342,3486786672,

%U 10460471356,31381059632,94143540948,282429536911,847289672390,2541865848120,7625600676808

%N a(n) = Sum_{d|n} d * 3^(n/d-1).

%F G.f.: Sum_{k>=1} k * x^k/(1 - 3 * x^k).

%F G.f.: Sum_{k>=1} 3^(k-1) * x^k/(1 - x^k)^2.

%t a[n_] := DivisorSum[n, 3^(n/#-1)*# &]; Array[a, 28] (* _Amiram Eldar_, Aug 27 2023 *)

%o (PARI) a(n) = sumdiv(n, d, d*3^(n/d-1));

%o (PARI) my(N=30, x='x+O('x^N)); Vec(sum(k=1, N, k*x^k/(1-3*x^k)))

%o (PARI) my(N=30, x='x+O('x^N)); Vec(sum(k=1, N, 3^(k-1)*x^k/(1-x^k)^2))

%Y Cf. A054599, A359190.

%K nonn,easy

%O 1,2

%A _Seiichi Manyama_, Dec 19 2022