Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
from fractions import Fraction
|
||||
|
||||
def muller_seq(n:int) -> float:
|
||||
seq = [Fraction(0), Fraction(2), Fraction(-4)]
|
||||
for i in range(3, n+1):
|
||||
next_value = (111 - 1130/seq[i-1]
|
||||
+ 3000/(seq[i-1]*seq[i-2]))
|
||||
seq.append(next_value)
|
||||
return float(seq[n])
|
||||
|
||||
for n in [3, 4, 5, 6, 7, 8, 20, 30, 50, 100]:
|
||||
print("{:4d} -> {}".format(n, muller_seq(n)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue