login
A098798
a(n) = Sum_{1<k<n and k not dividing n} floor(n/k).
1
0, 0, 1, 1, 4, 2, 8, 5, 10, 9, 17, 7, 23, 17, 21, 19, 34, 19, 40, 24, 38, 38, 52, 24, 56, 49, 55, 45, 73, 39, 81, 56, 75, 73, 83, 49, 104, 86, 94, 68, 118, 72, 126, 92, 104, 114, 140, 74, 144, 114, 139, 119, 165, 107, 159, 119, 163, 157, 189, 93, 201, 171, 169, 153, 200, 148
OFFSET
1,5
COMMENTS
a(n) = Sum(floor(n/k)*signum(n mod k): 1<=k<=n) = Sum(A010766(n,k)*(1-A051731(n,k)): 1<=k<=n).
LINKS
Enrique Pérez Herrero, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = A006218(n) - A000203(n). - Enrique Pérez Herrero, Dec 25 2012
a(n) = Sum_{i=1..n} floor(n/i) mod ceiling(n/i). - Wesley Ivan Hurt, Sep 15 2017
MATHEMATICA
Table[Plus@@(Floor[n/#]&/@Select[Range[n], !Divisible[n, #]&]), {n, 1, 20}] (* Enrique Pérez Herrero, Dec 25 2012 *)
PROG
(Python)
from math import isqrt
from sympy import divisor_sigma
def A098798(n): return -(s:=isqrt(n))**2+(sum(n//k for k in range(1, s+1))<<1)-divisor_sigma(n) # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Oct 05 2004
STATUS
approved