lots of errors there, for starters 1/2**(n-1) evaluates to zero if n is an integer. you need square brackets on your inline loops. google "pyhon tutorial" will bring up tons of good info to get you started..
–
agentpMay 17 '13 at 20:31