Skip to content

Instantly share code, notes, and snippets.

@naxmefy
Created April 22, 2021 23:23
Show Gist options
  • Save naxmefy/03cac14772081fcf62bb2c9fdfd96047 to your computer and use it in GitHub Desktop.
Save naxmefy/03cac14772081fcf62bb2c9fdfd96047 to your computer and use it in GitHub Desktop.
Print n terms of Conways sequence (without leading 0)
n=int(input())
f=[0,1,1]
for i in range(3,n+1):
f.append(f[f[i - 1]] + f[i - f[i - 1]])
print(*f[1:n+1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment