list
10 for Disc=-1 to 1 step 2
20 X=(-1+Disc*sqrt(1-4))/2
25 Tot=0
30 for I=1 to 9
40 Tot=Tot+(X^I+1/X^I)^2
45 print (X^I+1/X^I)
50 next
60 print Tot:print
70 next
OK
run
-1.0
-1.0-0.0000000000000000001#i
2.0
-1.0+0.0000000000000000003#i
-1.0-0.0000000000000000004#i
2.0
-1.0+0.0000000000000000006#i
-1.0-0.0000000000000000008#i
2.0
17.9999999999999999997+0.0000000000000000005#i
-1.0
-1.0+0.0000000000000000001#i
2.0
-1.0-0.0000000000000000003#i
-1.0+0.0000000000000000004#i
2.0
-1.0-0.0000000000000000006#i
-1.0+0.0000000000000000008#i
2.0
17.9999999999999999997-0.0000000000000000005#i
Regardless of whether x = -1/2 - i*sqrt(3)/2 or -1/2 + i*sqrt(3)/2, the terms being added are in sequence (-1)^2, (-1)^2, 2^2, repeated three times, or 1+1+4+1+1+4+1+1+4 = 18.
|
Posted by Charlie
on 2015-01-14 10:47:33 |