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.

A275495 a(n) = Sum_{k=2..n} floor(n/k) - 2*floor(n/(2*k)).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 4, 6, 7, 8, 7, 8, 9, 12, 10, 11, 12, 13, 12, 15, 16, 17, 14, 16, 17, 20, 19, 20, 21, 22, 19, 22, 23, 26, 24, 25, 26, 29, 26, 27, 28, 29, 28, 33, 34, 35, 30, 32, 33, 36, 35, 36, 37, 40, 37, 40, 41, 42, 39, 40, 41, 46, 42, 45, 46, 47, 46, 49
Offset: 1

Views

Author

Peter Luschny, Jul 30 2016

Keywords

Crossrefs

Cf. A002541, row sums of A275510, A059851.

Programs

  • Maple
    seq(add(floor(n/k)-2*floor(n/(2*k)), k=2..n), n=1..60); # Ridouane Oudra, Oct 20 2019
  • Mathematica
    Table[Sum[Floor[n/k] - 2*Floor[n/(2*k)], {k, 2, n}], {n, 1, 50}] (* G. C. Greubel, Jul 30 2016 *)
  • PARI
    a(n)=sum(k=2,n,n\k) - 2*sum(k=2,n\2,n\(2*k)) \\ Charles R Greathouse IV, Jul 30 2016
  • Sage
    [sum([floor(n/k) - 2*floor(n/(2*k)) for k in (2..n)]) for n in (1..69)]
    

Formula

a(n) = Sum_{i=1..n} floor((n-i)/i)*(-1)^(i+1). - Wesley Ivan Hurt, Sep 13 2017
a(n) = Sum_{i=2..n} (floor(n/i) mod 2) = A059851(n) - (n mod 2). - Ridouane Oudra, Oct 20 2019
a(n) ~ log(2) * n. - Vaclav Kotesovec, May 28 2021