Scanf.scanf "%d %d" @@ fun n k ->
  let rec f i s =
    if i = n + 1 then s
    else
      let j = (n - k) / i in
      f (i + 1) (s - k * (j + 1) + min (n + 1) (i * (j + 1))) in
  let ans = f (k + 1) (if k = 0 then k - n  else 0) in
  Printf.printf "%d\n" ans
