Next one in the series

Consider the series
0, 0 + 1, 0 + 1 + 2, 0 + 1 + 2 + 3, 0 + 1 + 2 + 3 + 4, …  =  0, 1, 3, 6, 10, …
Write a program that, for every given natural number n, prints the first
number of the series greater than or equal to n.

Input

Input consists of a sequence of natural numbers n.

Output

For every n, print the first number of the series 0, 1, 3, 6, … that is
greater than or equal to n.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:03:09.437Z

© Jutge.org, 2006–2026.
https://jutge.org
