OFFSET
1,2
COMMENTS
This is the "floor transform" of the powers of 2.
LINKS
Matthew House, Table of n, a(n) for n = 1..3305
FORMULA
a(n) ~ 2^n. - Vaclav Kotesovec, May 28 2021
From Seiichi Manyama, May 29 2021: (Start)
a(n) = Sum_{k=1..n} Sum_{d|k} 2^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 2*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 2^(k-1) * x^k/(1 - x^k). (End)
a(n) = Sum_{k=1..n} (2^floor(n/k) - 1). - Ridouane Oudra, Feb 03 2023
MAPLE
# floor transform of a sequence
ft:=proc(a) local b, n, j, k; b:=[];
for n from 1 to nops(a) do j:=add(a[k]*floor(n/k), k=1..n); b:=[op(b), j]; od;
b; end:
ft([seq(2^i, i=0..50)]);
MATHEMATICA
Table[Sum[Floor[n/k] 2^(k - 1), {k, n}], {n, 36}] (* Michael De Vlieger, Feb 12 2017 *)
PROG
(PARI) a(n) = sum(k=1, n, (n\k)*2^(k-1)); \\ Michel Marcus, Feb 11 2017
(PARI) a(n) = sum(k=1, n, sumdiv(k, d, 2^(d-1))); \\ Seiichi Manyama, May 29 2021
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-2*x^k))/(1-x)) \\ Seiichi Manyama, May 29 2021
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 2^(k-1)*x^k/(1-x^k))/(1-x)) \\ Seiichi Manyama, May 29 2021
(Magma)
A268235:= func< n | (&+[Floor(n/j)*2^(j-1): j in [1..n]]) >;
[A268235(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
(SageMath)
def A268235(n): return sum((n//j)*2^(j-1) for j in range(1, n+1))
[A268235(n) for n in range(1, 41)] # G. C. Greubel, Jun 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre and N. J. A. Sloane, Feb 05 2016
EXTENSIONS
Definition corrected by Matthew House, Feb 11 2017
STATUS
approved