OFFSET
1,2
COMMENTS
Partial sums of A339684.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{k=1..n} Sum_{d|k} 4^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 4*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 4^(k-1) * x^k/(1 - x^k).
a(n) ~ 4^n / 3. - Vaclav Kotesovec, Jun 05 2021
a(n) = (1/3) * Sum_{k=1..n} (4^floor(n/k) - 1). - Ridouane Oudra, Feb 16 2023
MAPLE
seq(add(4^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Feb 16 2023
MATHEMATICA
a[n_] := Sum[4^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, n\k*4^(k-1));
(PARI) a(n) = sum(k=1, n, sumdiv(k, d, 4^(d-1)));
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-4*x^k))/(1-x))
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 4^(k-1)*x^k/(1-x^k))/(1-x))
(Magma)
A344815:= func< n | (&+[Floor(n/j)*4^(j-1): j in [1..n]]) >;
[A344815(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
(SageMath)
def A344815(n): return sum((n//j)*4^(j-1) for j in range(1, n+1))
[A344815(n) for n in range(1, 41)] # G. C. Greubel, Jun 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, May 29 2021
STATUS
approved