cp's OEIS Frontend

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.

A268235 a(n) = Sum_{k=1..n} floor(n/k)*2^(k-1).

Original entry on oeis.org

1, 4, 9, 20, 37, 76, 141, 280, 541, 1072, 2097, 4192, 8289, 16548, 32953, 65860, 131397, 262764, 524909, 1049736, 2098381, 4196560, 8390865, 16781696, 33558929, 67117460, 134226585, 268452580, 536888037, 1073775900, 2147517725, 4295034280, 8590002605, 17180002736, 34359872001, 68719743792
Offset: 1

Views

Author

Benoit Cloitre and N. J. A. Sloane, Feb 05 2016

Keywords

Comments

This is the "floor transform" of the powers of 2.

Crossrefs

First differences give A034729.
Cf. A000079.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), this sequence (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • 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
    
  • 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 *)
  • 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
    
  • 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

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

Extensions

Definition corrected by Matthew House, Feb 11 2017