login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A075995
a(n) = Sum_{k=1..floor(n/2)} floor(n/k) for n >= 2, with a(1) = 1.
2
1, 2, 3, 6, 7, 11, 12, 16, 18, 22, 23, 29, 30, 34, 37, 42, 43, 49, 50, 56, 59, 63, 64, 72, 74, 78, 81, 87, 88, 96, 97, 103, 106, 110, 113, 122, 123, 127, 130, 138, 139, 147, 148, 154, 159, 163, 164, 174, 176, 182, 185, 191, 192, 200, 203, 211, 214, 218, 219, 231, 232
OFFSET
1,2
EXAMPLE
a(6) = floor(6/1) + floor(6/2) + floor(6/3) = 11.
MATHEMATICA
Table[If[n == 1, 1, Sum[Floor[n/i], {i, Floor[n/2]}]], {n, 80}] (* Wesley Ivan Hurt, Nov 26 2020 *)
PROG
(Python)
from math import isqrt
def A075995(n): return -(s:=isqrt(n))**2+(sum(n//k for k in range(1, s+1))<<1)-(n+1>>1) if n>1 else 1 # Chai Wah Wu, Oct 23 2023
CROSSREFS
a(n) = A006218(n) - floor((n+1)/2) for n >= 2.
Sequence in context: A253239 A226384 A298947 * A102432 A024561 A350573
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Sep 28 2002
EXTENSIONS
Name corrected by Wesley Ivan Hurt, Nov 26 2020
STATUS
approved