PInfinite Series
Statement
Goal
Given n, print the value of Sn with 15 decimals. S is an infinite product sequence:S1 = 2 * 2 / f1
S2 = 2 * 2 / f1 * 2 / f2
S3 = 2 * 2 / f1 * 2 / f2 * 2 / f3
etc.
With:
f1 = sqrt(2)
f2 = sqrt(2 + f1)
f3 = sqrt(2 + f2)
etc.
Input
An integer n.
Output
Value of Sn with 15 decimals.
Constraints
1 ≤ N ≤ 100
Example
Input
1
Output
2.828427124746190
Game modes
Fastest, Shortest
Test cases
Who's that one Test
Input
1
Output
2.828427124746190
Validator 1 Validator
Input
1
Output
2.828427124746190
Test 2 Test
Input
2
Output
3.061467458920718
Validator 2 Validator
Input
3
Output
3.121445152258052
Test 3 Test
Input
4
Output
3.136548490545939
Validator 3 Validator
Input
5
Output
3.140331156954753
Test 4 Test
Input
6
Output
3.141277250932773
Validator 4 Validator
Input
7
Output
3.141513801144301
Test 5 Test
Input
10
Output
3.141591421511200
Validator 5 Validator
Input
12
Output
3.141592576584873
Test 6 Test
Input
15
Output
3.141592652386592
Validator 6 Validator
Input
17
Output
3.141592653514595
Somebody I used to know Test
Input
20
Output
3.141592653588621
Validator 7 Validator
Input
24
Output
3.141592653589791
Looks familiar Test
Input
25
Output
3.141592653589795
Validator 8 Validator
Input
27
Output
3.141592653589797
Gosh that's PI !! Test
Input
95
Output
3.141592653589797
Validator 9 Validator
Input
100
Output
3.141592653589797
Solution language
Solution
Stub generator input