Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten.
He remembers that the remainder of a divided by b was greater than or equal to K.
Find the number of possible pairs that he may have had.

-----Constraints-----
 - 1 \leq N \leq 10^5
 - 0 \leq K \leq N-1
 - All input values are integers.

-----Input-----
Input is given from Standard Input in the following format:
N K

-----Output-----
Print the number of possible pairs that he may have had.

-----Sample Input-----
5 2

-----Sample Output-----
7

There are seven possible pairs: (2,3),(5,3),(2,4),(3,4),(2,5),(3,5) and (4,5).

Difficulty: interview

Starter code:

Solutions:
N, K = map(int, input().split())
ans = 0

if K == 0:
  print(N**2)
  return

for r in range(K, N):
  for q in range((N-r)//(r+1) + 1):
    if q == 0:
      ans += N - r
    else:
      ans += max(0, (N-r)//q - r)

print(ans)

n,k=map(int,input().split())
ans=0
if k==0:print(n**2);return
for b in range(k+1,n+1):
    div=n//b  
    ans+=(b-k)*div
    rem=n%b
    ans+=max(0,rem-k+1)
print(ans)

N, K = 5, 2

# N, K = 31415, 9265
#
# N, K = 10, 0

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


def calculate(n, k):
    result = 0
    for b in range(1, N + 1):
        p = n // b
        s1 = p * max(0, (b - 1 - (k - 1)))
        s2 = max(0, (n % b) - (k - 1))

        res = s1 + s2
        if k == 0:
            result = result + res - 1
        else:
            result = result + res

    print(result)


calculate(N, K)


n, k = map(int, input().split())

ans = 0
for i in range(k + 1, n + 1):
    ans += (n // i) * (i - k)
    if k == 0:
        m = n % i
    else:
        m = n % i - k + 1
    ans = max(ans, ans + m)

print(ans)

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""
全体からあまりがK未満を引く
"""
N, K = lr()
total = N * N
for b in range(1, N+1):
    if b <= K:
        total -= N
    else:
        total -= K * (N // b) + max(0, min(N % b, K - 1))
    #print(b, total)

answer = total
print(answer)


#!/usr/bin/env python3
import sys


def f(n, N, K):
    '''
    >>> f(2, 10, 2)
    0
    >>> f(1, 10, 0)
    10
    >>> f(1, 10, 1)
    0
    >>> f(2, 10, 1) # 1, 3, 5, 7, 9
    5
    >>> f(3, 10, 0) 
    10
    >>> f(3, 10, 1) # 1, 2, 4, 5, 7, 8, 10
    7
    >>> f(3, 10, 2) # 2, 5, 8
    3
    >>> f(5, 5, 2)
    3
    '''
    if n <= K:
        return 0
    if K == 0:
        return N
    ans = max(N % n - (K - 1), 0)
    ans += N // n * (n - K)
    return ans


def solve(N: int, K: int):
    ans = 0
    for b in range(N+1):
        #print(b, f(b, N, K))
        ans += f(b, N, K)
    return ans


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print((solve(N, K)))

def test():
    import doctest
    doctest.testmod()

def __starting_point():
    test()
    main()

__starting_point()

n, k = map(int, input().split())
res = 0
for i in range(k+1,n+1):
    res += (n // i) * (i - k)
    if  n%i != 0:
        res += max(n%i-max(k-1,0),0)
print(res)

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

t=0
for b in range(K+1,N+1):
  t+=(N//b)*(b-K)+((N%b-K+(1 if K>0 else 0) if N%b>=K else 0)if N%b else 0)
print(t)


N, K = map(int, input().split())
ans = 0
for p in range(K+1, N+1):
  k = N//p
  l = N%p
  a = k*(p-K)+ max(l-K+1,0)
  if(K == 0):
    a -= 1
  ans += a
print(ans)

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

if not K:
    print(N**2)
    return

ans = 0

for b in range(1, N+1):
    if b - 1 < K:
        continue

    _before = N // b
    _before_n = b - K
    ans += _before * _before_n

    _after = N % b
    if _after + 1 < K:
        continue

    ans += _after - K + 1

print(ans)

import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return list(map(int, input().split()))
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    N,K = i_map()
    if K == 0:
        print((N**2))
        return
        
    cnt = 0
    for i in range(1,N+1):
        b = N//i
        one = i - K
        if one > 0:
            cnt += one * b

        amari = N%i
        if amari >= K:
            cnt += amari - K + 1
    print(cnt)


def __starting_point():
    main()


__starting_point()

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

cnt = 0

for i in range(K+1, N+1):
    cnt += (N // i)*(i - K)
    if N%i >= K: cnt += N%i - K + 1
if K == 0:cnt -= N
print(cnt)

N,K = map(int,input().split())
ans = 0
if K == 0:
    print(N**2)
    return
for b in range(K+1,N+1):
    per = N//b
    rem = N%b
    if rem >= K:
        ans += (per+1)*(rem-K+1) + per * (b-1-rem)
    else:
        ans += per * (b-K)
print(ans)

import sys
readline = sys.stdin.readline

def main():
    N, K = map(int, readline().rstrip().split())
    if K == 0:
        print(N ** 2)
        return
    ans = 0
    for b in range(K, N+1):
        r = (N+1) % b
        p = (N+1) // b
        ans += (b-K) * p + max(0, r - K)

    print(ans)


def __starting_point():
    main()
__starting_point()

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

# a = pb + r 
# N = 10, b = 4
# a (0...10)
# r 0,1,2,3,0,1,2,3,0,1,2
ans = 0

for b in range(1,N+1):
  if b<=K:
    continue
  ans += ((N+1)//b) * (b-K)
  ans += max((N+1)%b-K, 0)
  if K == 0:
    ans -= 1
print(ans)

n,k = map(int, input().split())

# ans = 0
# for right in range(k+1, n+1):
#     for left in range(max(1,k), right):
#         while left <= n:
#             ans+=1
#             left+=right
# print(ans, flush=True)
# TLE

ans = 0
for b in range(1,n+1):
    ans += (n//b)*max(0,b-k) + max(n%b+1-k, 0)
    if k==0:
        ans -= 1
print(ans, flush=True)



N,K = map(int,input().split())
ans = 0
if K==0:
    print(N**2)
else:
    for b in range(K+1,N+1):
        ans += N//b*(b-K) + max(0,N%b-K+1)
    print(ans)

import math
n,k = map(int,input().split())
sum = 0
if k == 0:
	print(n**2)
else:
	for b in range(1,n+1):
		if n%b == 0:
			sum += math.floor(n/b)*max(b-k,0)
		else:
			sum += math.floor(n/b)*max(b-k,0) + max((n%b - k + 1),0)
	print(sum)

N, K = map(int, input().split())
ans = 0
for b in range(K+1,N+1):
    ans += (b-K)*(N//b)
    if N//b*b+K <= N:
        ans += N - (N//b*b+K) +1 
if K == 0:
    ans -= N
print(ans)

n, k = list(map(int, input().split()))
res = 0
if k == 0:
    print((n * n))
else:
    for i in range(k + 1, n + 1):
        res += (n // i) * (i - k) + max(0, n % i - k + 1)
    print(res)


n,k=map(int,input().split())
ans=0

if k==0:
    print(n**2)
else:
    for i in range(k+1,n+1):
        if n%i<k:
            ans+=n//i*(i-k)
        else:
            ans+=n//i*(i-k)+n%i-(k-1)
    
    print(ans)

n, k = map(int, input().split())

ans = 0
if k == 0:
  print (n**2)
  return
for i in range(1,n+1):
  if i <= k:
    continue
  ans += max(i-k,0)*(n//i) + max(n%i-(k-1),0)
print (ans)

N, K = map(int, input().split())
ans = 0
for i in range(1, N+1):
    p, r = divmod(N, i) 
    ans += max(0, i-K) * p + max(0, r-K+1)
    if K == 0:
        ans -= 1

print(ans)

def main():
    N, K = list(map(int, input().split(' ')))
    # K < b <= N
    # a =  K, ..., b - 1  # if K = 0, exclude the a = K case
    #      b + K, ..., b + b - 1
    #      2 * b + K, ..., 2 * b + b - 1
    #      ...
    ans = 0
    for b in range(K + 1, N + 1):
        ans += (N // b) * (b - K)
        ans += max([0, N % b - K + 1])
        if K == 0:
            ans -= 1
    print(ans)


def __starting_point():
    main()

__starting_point()

n,k=list(map(int,input().split()))
ans=n*n
if k!=0:
    ans-=k*n
    for b in range(k+1,n+1):
        tmp=(n//b)*(k)+min(n%b,k-1)
        ans-=tmp
print(ans)


n,k = map(int,input().split())
count = 0
if k == 0:
    print(n**2)
    return
for i in range(k+1,n+1):
    count += n//i*(i-k)
    m = n%i
    count += max(m-k+1,0)
print(count)

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

n,k=map(int,input().split())

ans=0
if k!=0:
    for i in range(k+1,n+1):
        ans+=n//i*(i-k)
        num=n//i*i
        ans+=max(0,n-num-k+1) 
else:
    ans=n**2
print(ans)

#!/usr/bin/env python3
N, K = map(int, input().split())
a = [i for i in range(1, N + 1)]
ans = 0
for b in range(1, N + 1):
    if K >= b:
        continue
    else:
        if K != 0:
            ans += (N // b) * (b - K) + max((N % b) - K + 1, 0)
        else:
            ans += N
print(ans)

import sys


def input():
    return sys.stdin.readline().strip()


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


def __starting_point():
    main()

__starting_point()

n,k=map(int,input().split())

sum=0
for b in range(k+1,n+1):
    re=n//b
    sum += re*(b-k)
    if k<=n%b:
        sum += n%b-k+1
if k==0:
    sum -= n
print(sum)

n,k= map(int,input().split())
ans=0
if k==0:print(n*n)
else:
    g=0
    for b in range(k+1,n+1):
        t = n//b
        g += t*(b-k)
        if t*b+k <= n < (t+1)*b:g += n-(t*b+k)+1
    print(g)

def main():
    n, k = list(map(int, input().split()))
    if k == 0:
        print((n * n))
        return
    ans = 0
    for i in range(k + 1, n + 1):
        p, q = divmod(n, i)
        ans += p * (i - k) + max(q - k + 1, 0)

    print(ans)


def __starting_point():
    main()

__starting_point()

N, K = map(int, input().split())
if K == 0:
    print(N**2)
    return
    
ans = 0
for b in range(K+1, N+1):
    ans += N//b * max(0, b - K) + max(0, N%b + 1 - K)

print(ans)

N, K = map(int, input().split())
if K == 0:
    print(N**2)
    return
    
ans = 0
for b in range(1, N+1):
    ans += N//b * max(0, b - K) + max(0, N%b - K + 1)

print(ans)

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))


N, K = mi()

cnt = 0
for b in range(K+1, N+1):
    #print(cnt)
    for x in range((N-K)//b+1):
        #print('a', min(N-(b*x+K), b-K))
        if b*x+K == 0:
            cnt -= 1
        cnt += min(N-(b*x+K)+1, b-K)
print(cnt)

n,k=map(int,input().split())
print(sum(n//b*(b-k)+max(n%b-k+1,0)-(k<1) for b in range(k+1,n+1)))

import sys
n, k = list(map(int, input().split()))
if k == 0:
  print((n * n))
  return
ans = n * n
for b in range(1, n + 1):
  if b <= k:
    ans -= n
    continue
  ans -= (n + 1) // b * k - 1
  ans -= min((n + 1) % b, k)
print(ans)


n,k = map(int,input().split())
ans = 0
for b in range(1,n+1):
    p = n//b
    r = n%b
    ans += p*max(0,b-k)+max(0,r-k+1)
if k == 0: ans -= n
print(ans)

n, k = list(map(int, input().split()))

ans = 0

for b in range(k+1,n+1):
  s = n // b
  a = n % b
  ans += s * (b - k)
  ans += max(a - k + 1, 0)
  if k == 0:
    ans -= 1

print(ans)


N,K=map(int,input().split())
ans=0
if K==0:
  print(N*N)
  return
for b in range(K+1,N+1):
  _=(N//b)*(b-K)+max(0,(N%b)-K+1)
  ans+=_
  #print(b,_)
print(ans)

n,k=list(map(int,input().split()))
ans=0
for b in range(k+1,n+1):
  res=(n-k)%b
  quo=(n-k)//b
  if b-k-1>res:
    #ans+=(res+1)*(quo+1)+(b-k-res-1)*quo
    ans+=(b-k)*quo+res+1
  else:
    ans+=(b-k)*(quo+1)
  ans-=(k==0)
    
print(ans)

#n-k-j>=b*r  j=0,...,b-k-1


n , k = list(map(int, input().split()))

if k==0:
    ans = (1+n-1)*(n-1)//2
else:
    ans = (1+n-k)*(n-k)//2


if k==0:
    for i in range(1,n+1):
        ans +=n//i

for i in range(k,n):
    if i==0:
        continue
    for j in range(1,n//i+1):
        if j*(i+1)+i<=n:
            ans+=(n-(j*(i+1)+i))//j+1
        if j*(i+1)+i>n:
            break

print(ans)


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

n, k = map(int, input().split())

if k == 0:
    print(n * n)
    return

ans = 0
for i in range(k+1, n+1):
    quo, rem = divmod(n, i)
    ans += quo * (i-k)
    if rem >= k:
        ans += rem - k + 1

print(ans)

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

N,K = map(int, open(0).read().split())
ans = 0
if K == 0:
    print(pow(N,2))
else:
    for b in range(K+1,N+1):
        d, m = divmod(N,b)
        ans += d * (b-K) + max(0,(m-K+1))
    print(ans)

n, k = map(int, input().split())
s = 0
for i in range(1, n+1):
    q, r = divmod(n+1, i)
    s += q*max(i-k, 0) + max(r-k, 0)
s -= n * (k==0)
print(s)

n,k=map(int,input().split())
c=0
for b in range(k+1,n+1):
  c+=n//b*(b-k)+max(n%b-k+1,0)-(k<1)
print(c)

n, k = map(int, input().split())
if k == 0:
    print(n ** 2)
else:
    c = 0
    for b in range(k + 1, n + 1):
        c += (n // b) * (b - k) + max(n % b - k + 1, 0)
    print(c)

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n,k=map(int,readline().split())

    if k==0:
        print(n**2)
    else:
        res=0
        for b in range(1,n+1):
            if b<=k:
                continue
            else:
                m=n//b
                l=n%b
                res+=(b-k)*m
                res+=max(0,l-k+1)

        print(res)

def __starting_point():
    main()
__starting_point()

#bはKより真に大きい、N以下
#aはK以上

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

count = 0
for b in range(K+1, N+1):
    x = N // b
    y = N % b
    count += x * (b-K)
    count += max(0, (y-max(1,K)+1))

print(count)


N, K = map(int, input().split())
ans = 0
if K == 0:
  print(N**2)
  return
for b in range(K+1, N+1):
  #print(b)
  #print(N // b * (b - K), max((N%b)-(K-1), 0))
  ans += N // b * (b - K)
  ans += max((N%b)-(K-1), 0)
print(ans)

n,k=map(int,input().split())
print(sum(n//b*(b-k)+max(n%b-k+(k>0),0) for b in range(k+1,n+1)))

def main():
    n, k = list(map(int, input().split()))
    ans = 0
    for b in range(1, n + 1):
        q, r = divmod(n, b)
        ans += q * max(0, b - k)
        ans += max(0, r - k + 1)
    if k == 0:
        ans -= n
    print(ans)





def __starting_point():
    main()

__starting_point()

n, k = list(map(int, input().split()))
if k == 0:
    print((n**2))
    return
ans = 0
for i in range(k, n+1):
    p = n // i
    r = n % i
    ans += p * (i - k) + max(0, (r - k + 1))

print(ans)


n, k = map(int, input().split())
ans = 0

if k == 0:
    print(n*n)
    return

# mod b ということは、あまり0~b-1が n // b回つづく
for b in range(k, n+1):
    x = n // b
    y = n % b
    ans += (b-k) * x
    if y >= k:
        ans += y + 1 - k
print(ans)

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

cnt=0
if K==0:
  cnt = N*N
else:
  for b in range(1,N+1):
    p=N//b
    q=N%b
    cnt += p * max(0, b-K)
    cnt += max(0,q-K+1)
    #print(p * max(0, b-K),max(0,q-K+1))
    
    
print(cnt)

n, k = map(int, input().split())
a = 0
for b in range(1, n + 1):
    p, q = divmod(n, b)
    a += max(0, b - k) * p + max(0, q - k + 1)
print(a if k else n*n)

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

from math import floor
N,K = map(int,input().split())
ans = 0
for b in range(K+1, N+1):
    p,r = N//b,N%b
    ans += p*max(0,b-K)+max(0,r-K+1)
print(ans if K!=0 else ans-max(0,b-K))

N,K=map(int,input().split())
if K==0:
  print(N**2)
  return
ans=0
for i in range(1,N+1):
  q,r=divmod(N,i)
  ans += q*max(0,i-K)+max(0,r-K+1)
print(ans)

n, k = map(int, input().split())
ans = 0
if k == 0:
  print(n**2)
  return
for i in range(k+1,n+1):
  a = n-n%i
  ans += (i-k)*(a//i)
  if n%i >=k:
    ans += n%i-k+1
print(ans)

n, k = list(map(int, input().split()))

s = 0

if k == 0:
    print(n ** 2)
else:
    for i in range(k+1, n+1):
        if n % i < k:
            s += n // i * (i - k)
        else:
            s += n // i * (i - k) + n % i - (k-1)
        
    print(s)

n,k = map(int,input().split())
if k ==0:
    print(n*n)
    return
ans = 0
for b in range(k+1,n+1):
    p = n//b
    r = n%b
    ans += max(b-k,0)*p + max(r+1-k,0)
print(ans)

n,k = map(int, open(0).read().split())

ans = 0

for b in range(k+1, n+1):
    c = n//b*(b-k)
    if k:
        d = max(0, n%b-k+1)
    else:
        d = n%b
    ans += c
    ans += d

print(ans)

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

if K==0:
    print((N*N))
else:
    for b in range(K+1,N+1):
        x=N//b
        ans+=(b-K)*x
        y=N%b
        ans+=max(0,y-K+1)
    print(ans)


n, k = map(int, input().split())
ans = 0
for b in range(k + 1, n + 1):
    temp = n // b
    temp2 = n % b
    ans += temp * (b - k) + max(temp2 - max(0, (k - 1)), 0)
print(ans)

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

n,k = map(int, input().split())

if k ==0:
    print(n**2)
    return

res=0
for i in range(k+1,n+1):
    a = n//i
    res += (i-k)*a
    b = n % i
    res += max(0,b-k+1)

print(res)

import numpy as np
n,k = list(map(int,input().split()))

a = np.array([0]*n,dtype ='int64')
a[0] += n
for i in range(1,n):
    c = n // (1+i)
    d = n % (1+i)
    a[1:i+1] += c
    a[0] +=c
    if d > 0:
        a[1:d+1] +=1
print((np.sum(a[k:])))


def solve(N,K):
    if K == 0:
        return N**2
    else:
        ans = 0
        for b in range(K+1,N+1):
            #b <= a <= Nで a mod b >= Kを満たすaの個数
            q,r = N//b,N%b
            ans += (q*(b-K) + max(0,r-K+1))
        return ans

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

    print((solve(N,K)))

def __starting_point():
    main()

__starting_point()

N,K = map(int,input().split())
ans = 0

for n in range(K+1,N+1):
  ans+=N//n*(n-K)+max(N%n-max(K-1,0),0)

print(ans)

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

N, K = map(int, input().split())
ans = 0

for b in range(K+1, N+1):
  n = b - K
  t = N // b
  r = N % b
  ans += n*t + max(0, r - max(K-1, 0))

print(ans)

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

cnt = 0
for i in range(K + 1, N + 1):#b = K + 1 ... N
  k = int(N / i)
  l = N % i
  if K == 0:
    cnt += k * (i - K) + max(0, l - K)
  else:
    cnt += k * (i - K) + max(0, l - K + 1)
  #print(cnt, k, l)
  
print(cnt)  


def find_ans(N,K):
    # K==0ならN^2が答え
    if K==0:
        return N**2
    
    # そうでなければK+1～Nについて一般式
    else:
        ans = 0
        for i in range(K+1,N+1):
            ans += (N//i)*(i-K) + max(N%i-(K-1), 0)
            
        return ans
    
N,K = list(map(int, input().split()))
print((find_ans(N,K)))


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

ans = 0

for b in range(1,N+1):
  if b<=K:
    continue
  ans += (N//b) * (b-K)
  ans += max(N%b-K+1, 0)
  if K == 0:
    ans -= 1
print(ans)


n,k=map(int,input().split())
ans=0
for b in range(k+1,n+1):
  r=n%b
  q=n//b
  ans+=(b-k)*q+max(r-max(k-1,0),0)
print(ans)

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, K = list(map(int, readline().split()))

    if K == 0:
        ans = N * N
    else:
        ans = 0
        for b in range(K + 1, N + 1):
            ans += N // b * (b - K) + max(N % b - K + 1, 0)

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

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

import sys
readline = sys.stdin.readline

def main():
    N, K = map(int, readline().rstrip().split())
    res = 0
    for b in range(1, N+1):
        p = (N+1) // b
        r = (N+1) % b
        res += max(b - K, 0) * p + max(r - K, 0)
    
    if K == 0:
        print(N ** 2)
    else:
        print(res)


def __starting_point():
    main()
__starting_point()

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

ans = 0
for b in range(K + 1, N + 1):
    ans += (N // b) * (b - K)
    if N % b >= K:
        ans += (N % b) - K + 1
if K == 0:
    ans -= N
print(ans)



n,k = map(int,input().split())
if k==0:
    print(n**2)
else:
    ans = 0
    for b in range(k,n+1):
        ans += (n//b)*(b-k)
        if n%b>=k:
            ans += n%b-(k-1)
    print(ans)

n, k = map(int, input().split())

ans = 0
for b in range(1, n+1):
    loop = n//b
    ans += max(0, b-k)*loop + max(0, n%b-k+1)
if k==0:
    ans-=n
print(ans)

N, K = list(map(int, input().split()))
if K == 0:
    print(N**2)
else:
    res = 0
    for b in range(1, N+1):
        L = max(b-K, 0)
        res += L*(N//b) + max(0, (N%b)+1-K)

    print(res)

n, k =map(int, input().split())
cnt=0

if k==0:
	print(n**2)
	return

for b in range(k+1,n+1):
	p,r=divmod(n,b)
	cnt+=p*(b-k)+max(0,r-k+1)
print(cnt)

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

t=0
for b in range(K+1,N+1):
  t+=(-~N//b)*(b-K)+max(-~N%b-K,0)
print((t-(0 if K else N-K)))


n, k = list(map(int, input().split()))

ans = 0
if k == 0:
    ans = n*n
else:
    for b in range(k+1, n+1):
        p = n // b
        ans += (b-k)*p
        r = n % b
        if r >= k:
            ans += r-k+1
print(ans)


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

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

if '__main__' == __name__:
    resolve()

#!/usr/bin/env python3

n, k = list(map(int, input().split()))

ans = 0
for i in range(k+1, n+1):
    num = n//i
    ans_tmp = num * (i-k)
    ans_tmp += max(0, n % i - k + 1)
    if k == 0:
        ans_tmp -= 1
    ans += ans_tmp
    # print(num * (i-k))
    # print(max(0, n % i - k + 1))
    # print()
print(ans)


import sys

n,k=list(map(int,input().split()))

if k==0:
    print((n*n))
    return
    
icnt=0
for ki in range(k+1,n+1):
    qki=n//ki
    icnt+=qki*(ki-k)+max(n%ki-(k-1),0)

print(icnt)    


n, k = [int(x) for x in input().split()]

if k == 0:
    print(n ** 2)
    return

ans = 0
for b in range(k + 1, n + 1):
    q, mod = divmod(n, b)
    ans += q * (b - k)
    if mod >= k:
        ans += mod - k + 1
print(ans)

N,K=map(int,input().split())
ans=0
if K==0:
  print(N**2)
else:
  for i in range(K+1,N+1):
    ans+=(N//i)*(i-K)
    if (N%i)-K+1>0:
      ans+=(N%i)-K+1
  print(ans)

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

if K==0:
  print(N*N)
  return
  
print(sum([(N//b)*(b-K)+max(N%b-K+1, 0) for b in range(K+1, N+1)]))

n,k=list(map(int,input().split()))

#a=b*x+kk  (k<kk<b)

if k==0:
    print((n**2))
    return

cnt=0
for b in range(k+1,n+1):
    ux=n//b
    if n%b==0:
        umod=0
    else:
        umod=max(0,n%b-k+1)
    dmod=max(0,b-k)
    #print(b,"##############")
    #print(umod,dmod)

    cnt+=umod+dmod*(ux)

print(cnt)