Skip to content

Instantly share code, notes, and snippets.

@gubatron
Created October 15, 2013 04:16
Show Gist options
  • Select an option

  • Save gubatron/6986393 to your computer and use it in GitHub Desktop.

Select an option

Save gubatron/6986393 to your computer and use it in GitHub Desktop.
def lacsap(n):
if n==0:
return [2]
if n == 1:
return [2,2]
else:
coeficientsToGenerate = n-1
above = lacsap(n-1)
lenAbove = len(above)
result = [2]
i=0
while i < (lenAbove-1):
result = result + [above[i]*above[i+1]]
i = i + 1
result = result + [2]
return result
for i in range(0,8):
lacsap(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment