login
a(n) = Sum_{k=3..n} floor(n/k).
5

%I #14 Oct 30 2023 11:12:43

%S 0,0,1,2,3,5,6,8,10,12,13,17,18,20,23,26,27,31,32,36,39,41,42,48,50,

%T 52,55,59,60,66,67,71,74,76,79,86,87,89,92,98,99,105,106,110,115,117,

%U 118,126,128,132,135,139,140,146,149,155,158,160,161,171,172,174,179,184

%N a(n) = Sum_{k=3..n} floor(n/k).

%F G.f.: 1/(1-x) * Sum_{k>=1} x^(3*k)/(1-x^k) = 1/(1-x) * Sum_{k>=3} x^k/(1-x^k).

%F a(n) = A006218(n)-n-floor(n/2). - _Chai Wah Wu_, Oct 30 2023

%o (PARI) a(n) = sum(k=3, n, n\k);

%o (Python)

%o from math import isqrt

%o def A366968(n): return -(s:=isqrt(n))**2+(sum(n//k for k in range(3,s+1))<<1)+n+(n>>1) if n>3 else int(n>2) # _Chai Wah Wu_, Oct 30 2023

%Y Column k=3 of A134867.

%Y Partial sums of A023645.

%Y Cf. A006218, A366969, A366970, A366971.

%K nonn,easy

%O 1,4

%A _Seiichi Manyama_, Oct 30 2023