Ask Your Question

Vincent's profile - activity

2011-05-15 13:22:11 +0200 received badge  Supporter (source)
2011-05-15 12:13:33 +0200 received badge  Editor (source)
2011-05-15 11:55:37 +0200 answered a question How-to: sum

I met a similar problem. Take the following example.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    print sum(k^(2^i),i,0,3)

which prints:

Traceback (click to the left of this block for traceback)
...
TypeError: unable to convert x (=i) to an integer

Let us try another syntax.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    sum([k^(2^i) for i in [0..3]])

Now it is okay thanks to the previous answer. I wonder if it's possible to make it work with the first syntax.