def main():

    N, K = list(map(int, input().split()))

    cnt = 0

    for b in range(1,N+1):

        cnt += (N // b) * max(0, b - K)

        cnt += max(0, (N % b) + 1 - K)



    if K == 0:

        cnt -= N



    print(cnt)





if __name__ == "__main__":

    main()
def num_divisors_cnt(n):

    table = [0] * (n + 1)

    

    for i in range(1, n+1):

        for j in range(i, n + 1, i):

            table[j] += 1

    

    return table



def main():

    N, K = list(map(int, input().split()))

    ans = 0

    

    for i in range(K+1,N+1):

        cnt = i - K

        cnt *= N // i

        cnt += max((N % i) - K + 1,0)

        ans += cnt

    if K == 0:

        ans -= N

    print(ans)





if __name__ == "__main__":

    main()
def main():
    N, K = list(map(int, input().split()))
    cnt = 0
    for b in range(1, N + 1):
        cnt += (N // b) * max(0, b - K)
        cnt += max(0, (N % b) + 1 - K)
    if K == 0:
        cnt -= N
    print(cnt)


if __name__ == "__main__":
    main()

def num_divisors_cnt(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table


def main():
    N, K = list(map(int, input().split()))
    ans = 0
    for i in range(K + 1, N + 1):
        cnt = i - K
        cnt *= N // i
        cnt += max((N % i) - K + 1, 0)
        ans += cnt
    if K == 0:
        ans -= N
    print(ans)


if __name__ == "__main__":
    main()

+def num_divisors_cnt(n): +    table = [0] * (n + 1) +    for i in range(1, n + 1): +        for j in range(i, n + 1, i): +            table[j] += 1 +    return table + + -    cnt = 0 -    for b in range(1, N + 1): -        cnt += (N // b) * max(0, b - K) -        cnt += max(0, (N % b) + 1 - K) +    ans = 0 +    for i in range(K + 1, N + 1): +        cnt = i - K +        cnt *= N // i +        cnt += max((N % i) - K + 1, 0) +        ans += cnt -        cnt -= N -    print(cnt) +        ans -= N +    print(ans)