Skip to content

Commit

Permalink
Merge branch 'main' of github.com:wellington36/acceleration_algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
wellington36 committed Mar 4, 2023
2 parents c582ff6 + 43bb777 commit bad6325
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ In `acceleration.py` we have functions that receive a list of the values of the
from acceleration import Aitken_tranform

# a zeta(2) series
def square_series(n: int) -> list:
series = [1.0]
def square_series(n: int) -> np.ndarray:
"""Zeta(2) series, sum of math.pi**2 / 6"""
series = np.zeros(n, dtype='float64')
series[0] = 1.0

for i in range(2, n+1):
series.append(series[-1] + 1/(i)**2)
for i in range(1, n):
series[i] = series[i-1] + 1/(i+1)**2

return series

Expand Down

0 comments on commit bad6325

Please sign in to comment.