Apr-18-2019, 09:05 PM
As I said, nested for loops and nested lists. I think this will work:
def ln(x, n): a =[(1 + x) / 2] g =[x ** (1 / 2)] for i in range(n): a.append((a[i] + g[i]) / 2) g.append((a[i+1] * g[i]) ** (1 / 2)) d = [a[:]] for i in range(1, n + 1): d.append([]) for k in range(i, n + 1): d.append(d[-2][k - i - 1] - 4 ** (-1) * d[-2][k - i] / (1 - 4 ** (-i))) return (x - 1) / d[-1][0]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures