View Single Post
Hepth
#7
Jul15-09, 11:21 AM
PF Gold
Hepth's Avatar
P: 466
Because of your sums and their indices. To fix this, add:

If[M > 1, m = M, m = 0];

before the second For loop. It changes the greater than equal to to just a greater than. That way the second sum in the second for loop doesn't go from 1 to 0 (1 to M-r1 == M-m==0)