| 1 | initial version |
What you wrote works. You were just missing a colon after else.
def a(n):
if n==1:
return 1
else:
return a(n-1)+1/a(n-1)^2
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.