%I #27 Jun 26 2024 19:52:51
%S 1,5,15,46,128,384,1114,3332,9903,29671,88721,266151,797593,2392649,
%T 7175709,21526834,64573556,193720536,581141026,1743422288,5230207428,
%U 15690619684,47071679294,141215037738,423644574301,1270933715189,3812799550089,11438398630159
%N a(n) = Sum_{k=1..n} floor(n/k) * 3^(k-1).
%C Partial sums of A034730.
%H Seiichi Manyama, <a href="/A344814/b344814.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = Sum_{k=1..n} Sum_{d|k} 3^(d-1).
%F G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 3*x^k).
%F G.f.: (1/(1 - x)) * Sum_{k>=1} 3^(k-1) * x^k/(1 - x^k).
%F a(n) ~ 3^n / 2. - _Vaclav Kotesovec_, Jun 05 2021
%F a(n) = (1/2) * Sum_{k=1..n} (3^floor(n/k) - 1). - _Ridouane Oudra_, Feb 05 2023
%p seq(add(3^(k-1)*floor(n/k), k=1..n), n=1..60); # _Ridouane Oudra_, Feb 05 2023
%t a[n_] := Sum[3^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* _Amiram Eldar_, May 29 2021 *)
%o (PARI) a(n) = sum(k=1, n, n\k*3^(k-1));
%o (PARI) a(n) = sum(k=1, n, sumdiv(k, d, 3^(d-1)));
%o (PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-3*x^k))/(1-x))
%o (PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 3^(k-1)*x^k/(1-x^k))/(1-x))
%o (Magma)
%o A344814:= func< n | (&+[Floor(n/k)*3^(k-1): k in [1..n]]) >;
%o [A344814(n): n in [1..40]]; // _G. C. Greubel_, Jun 26 2024
%o (SageMath)
%o def A344814(n): return sum((n//k)*3^(k-1) for k in range(1,n+1))
%o [A344814(n) for n in range(1,41)] # _G. C. Greubel_, Jun 26 2024
%Y Column k=3 of A344821.
%Y Cf. A059851, A268235, A332533, A344815, A344816, A344817, A344818, A344819, A344820.
%K nonn
%O 1,2
%A _Seiichi Manyama_, May 29 2021