import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import std.csv;
import std.regex;
import std.math;
import core.time;
import std.ascii;
import std.digest.sha;
import std.outbuffer;
import std.numeric;

void main()
{
	int n, k;
	readln.chomp.split.tie(n, k);
	long cnt = 0;
	debug {
		int ans = 0;
		/+
		for (int a = 1; a <= n; ++a) {
			for (int b = 1; b <= n; ++b) {
				if (a % b >= k) {
					verbose(a, b);
					++ans;
				}
			}
		}
		+/
		for (int b = 1; b <= n; ++b) {
			for (int a = b + 1; a <= n; ++a) {
				if (a % b >= k) {
					verbose(a, b, "...", a % b);
					++ans;
				}
			}
		}
		for (int a = 1; a <= n; ++a) {
			for (int b = a + 1; b <= n; ++b) {
				if (a % b >= k) {
					verbose(a, b, "...", a % b);
					++ans;
				}
			}
		}
		verbose("ans", ans);
	}
	// 上 (a <= b)
	for (int a = max(k, 1); a <= n; ++a) {
		cnt += n - a;
	}
	debug verbose("ue", cnt);
	// 下 (a > b)
	for (int b = k + 1; b <= n; ++b) {
		if (k == 0) {
			cnt += n - b + 1;
		} else {
			debug verbose(b);
			for (int d = 0; d < b - k; ++d) {
				if (n < k + b + d) {
					break;
				}
				int v = (n - (k + b + d)) / b + 1;
				debug verbose("\t", d, v);
				int w = v - 1;
				w *= b;
				int x = n - w - k - b;
				debug verbose("\t\tx = ", x, n - (k + b + x));
				x = min(x, b - k - 1);
				debug verbose("\t\tx' = ", x);
				cnt += (x - d + 1) * v;
				d = x;
			}
		}
	}
	cnt.writeln;
}

void tie(R, Args...)(R arr, ref Args args)
		if (isRandomAccessRange!R || isArray!R)
in
{
	assert (arr.length == args.length);
}
body
{
	foreach (i, ref v; args) {
		alias T = typeof(v);
		v = arr[i].to!T;
	}
}

void verbose(Args...)(in Args args)
{
	stderr.write("[");
	foreach (i, ref v; args) {
		if (i) stderr.write(", ");
		stderr.write(v);
	}
	stderr.writeln("]");
}
