Back
Close

Multiply and sum

Statement

 Goal

Given a number you must multiply it by itself and all numbers below it and return the total sum of each multiplication.

Example 1:
Input = 5
5*5+5*4+5*3+5*2+5*1=75
return 75

Example 2:
Input = 3
3*3+3*2+3*1=18
return 18
Input
Line 1: An integer N as the number to use to multiply.
Output
Line 1: An integer.
Constraints
0 ≤ N ≤ 9999
Example
Input
4
Output
40

Game modes
Fastest, Shortest, Reverse

Test cases
Test 1 Test
Input
4
Output
40

Validator 1 Validator
Input
7
Output
196

Test 2 Test
Input
5
Output
75

Validator 2 Validator
Input
8
Output
288

Test 3 Test
Input
15
Output
1800

Validator 3 Validator
Input
25
Output
8125

Test 4 Test
Input
58
Output
99238

Validator 4 Validator
Input
93
Output
406503

Test 5 Test
Input
502
Output
63379006

Validator 5 Validator
Input
685
Output
160944175

Test 6 Test
Input
0
Output
0

Validator 6 Validator
Input
0
Output
0

Test 7 Test
Input
5210
Output
70723952550

Validator 7 Validator
Input
9635
Output
447270478050

Solution language

Solution

Stub generator input