Back
Close

Sum of the odds

Statement
The program:
Your task is to find the sum of the first N odd natural numbers
INPUT:
Line1: An integer N number of odds to sum up

OUTPUT:
Line1: Sum of the first N odds

CONSTRAINTS:
0 < N < 1000

EXAMPLE:
Input
1
Output
1
 

Game modes
Fastest, Shortest

Test cases
One Test
Input
1
Output
1

Two Validator
Input
2
Output
4

Small case Test
Input
14
Output
196

Small test Validator
Input
15
Output
225

Big test Test
Input
491
Output
241081

Big test Validator
Input
548
Output
300304

Maximum Test
Input
999
Output
998001

Almost maximum Validator
Input
983
Output
966289

Solution language

Solution

Stub generator input