let rec for_iter a b f = if a > b then [] else let x = f a in x :: for_iter (a+1) b f
let () =
  Scanf.scanf "%d %d" (fun n k ->
    if k = 0 then n*n
    else
      for_iter (k+1) n (fun b -> (n+1) / b * (b-k) + max 0 ((n+1) mod b - k))
      |> List.fold_left (+) 0)
  |> Printf.printf "%d\n"