[ create a new paste ] login | about

Link: http://codepad.org/vKTSWZqI    [ raw code | output | fork ]

Python, pasted on Aug 20:
1
2
3
4
5
6
7
def reciprocal(c,y0,n):
	arr=[]
	for i in range(n):
		arr.append(y0)
		y0=y0*(2-c*y0)
        return arr
print reciprocal(3,0.1,10)


Output:
1
[0.10000000000000001, 0.17000000000000001, 0.25330000000000003, 0.31411733000000003, 0.3322255689810133, 0.33332965190775249, 0.33333333329267462, 0.33333333333333337, 0.33333333333333337, 0.33333333333333337]


Create a new paste based on this one


Comments: