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”).

a(n) = Sum_{k=1..floor(n/2)} floor(n/k) for n >= 2, with a(1) = 1.
2

%I #10 Oct 23 2023 17:25:18

%S 1,2,3,6,7,11,12,16,18,22,23,29,30,34,37,42,43,49,50,56,59,63,64,72,

%T 74,78,81,87,88,96,97,103,106,110,113,122,123,127,130,138,139,147,148,

%U 154,159,163,164,174,176,182,185,191,192,200,203,211,214,218,219,231,232

%N a(n) = Sum_{k=1..floor(n/2)} floor(n/k) for n >= 2, with a(1) = 1.

%e a(6) = floor(6/1) + floor(6/2) + floor(6/3) = 11.

%t Table[If[n == 1, 1, Sum[Floor[n/i], {i, Floor[n/2]}]], {n, 80}] (* _Wesley Ivan Hurt_, Nov 26 2020 *)

%o (Python)

%o from math import isqrt

%o 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

%Y a(n) = A006218(n) - floor((n+1)/2) for n >= 2.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Sep 28 2002

%E Name corrected by _Wesley Ivan Hurt_, Nov 26 2020