Scanf.scanf "%d" (fun n -> let rec loop x acc = if x > n then acc else loop (x + 1) (acc + n - x + 1) in loop 0 0 |> Printf.printf "%d\n" )