#C9267. Find Sequence Number
Find Sequence Number
Find Sequence Number
You are required to compute the nth number in a sequence where each term is the sum of all natural numbers up to n. In other words, the nth term of the sequence is defined as:
\(S(n) = 1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}\)
Your task is to take an integer n from standard input and output the value of \(S(n)\) to standard output.
inputFormat
The input consists of a single integer n (n ≥ 1) provided via standard input.
outputFormat
Output the nth number in the sequence, i.e. the sum of the first n natural numbers. The answer is given by the formula: \(\frac{n(n+1)}{2}\).
## sample1
1