fork(1) download
  1. L=[1,0,-1,0,1,0,-1,0]
  2. E=[1]+[0]*~-len(L)
  3. F=[]
  4. I=[]
  5.  
  6. i=f=1
  7. while len(F)<len(L):
  8. F.append(f)
  9. L[i-1]/=f
  10. f *= i
  11. i += 1
  12.  
  13. for i in range(len(L)):
  14. c = E[i]/L[0]
  15. I.append(c*F[i])
  16. for j in range(len(L)-i):
  17. E[i+j] -= c*L[j]
  18.  
  19. print(I)
  20.  
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
[1.0, 0.0, 1.0, 0.0, 5.0, 0.0, 61.0, 0.0]