10 lines
417 B
Python
10 lines
417 B
Python
|
import math
|
||
|
if __name__ == "__main__":
|
||
|
row_value = round(math.pi**2/6, 6) # = 1.644934
|
||
|
sum_of_reciprocal_squares = 0
|
||
|
divider = 1
|
||
|
while row_value != round(sum_of_reciprocal_squares, 6):
|
||
|
sum_of_reciprocal_squares += 1/divider**2
|
||
|
divider += 1
|
||
|
print("After adding the first " + str(divider-1) + " reciprocal square numbers the sum equals " + str(round(sum_of_reciprocal_squares, 6)))
|