Considering N numbers n, give for each n the sum of the factorials fo the numbers 1 to n :
S(n) = 1! + 2! + 3! + ... + (n-1)! + n!
Input
- 50 ≤ N ≤ 100
- 1000 ≤ n ≤ 3000
Examples
Input :
10
13
20
Output :
4037913
6749977113
2561327494111820313
Considering N numbers n, give for each n the sum of the factorials fo the numbers 1 to n :
S(n) = 1! + 2! + 3! + ... + (n-1)! + n!
Input :
10
13
20
Output :
4037913
6749977113
2561327494111820313
Évènement organisé par ALIAS