I wrote a maple code and it returns: if statement error to me.

How can I fix it?

Regards

F1 := proc (rlist, deltalist) local sum1, i; sum1 := 0; for i to 8 do sum1 := sum1+rlist[i]*deltalist[i] end do; if `mod`(sum1, 24) = 0 then return true else return false end if end proc;

F2 := proc (rlist, deltalist) local i, sum2; sum2 := 0; for i to 8 do if deltalist <> 0 then sum2 := sum2+40*rlist[i]/deltalist[i] end if end do; if `mod`(sum2, 24) = 0 then return true else return false end if end proc;

F3 := proc (rlist, deltalist) local product, i; product := 1; for i to 8 do product := product*deltalist[i]^rlist[i] end do; if ceil(sqrt(product)) = sqrt(product) then return true else return false end if end proc;

myProc40:=proc(deltalist) local r1, r2, r4, r5, r8, r10, r20, r40,rlist: for r1 from -1 to 3 do for r2 from -1 to 3 do for r4 from -1 to 3 do for r5 from -1 to 3 do for r8 from -1 to 3 do for r10 from -1 to 3 do for r20 from -1 to 3 do for r40 from -1 to 3 do rlist:=[r1,r2,r4,r5,r8,r10,r20,r40]: if (F1(rlist, deltalist) = true) then if(F2(rlist,deltalist)=true ) then if (F3(rlist, deltalist) = true) then if ((gcd(1,1)^(2)*r1)/(1)+(gcd(1,2)^(2)*r2)/(2)+(gcd(1,4)^(2)*r4)/(4)+(gcd(1,5)^(2)*r5)/(5)+(gcd(1,8)^(2)*r8)/(8)+(gcd(1,10)^(2)*r10)/(10)+(gcd(1,20)^(2)*r20)/(20)+(gcd(1,40)^(2)*r40)/(40)>0) and ((gcd(2,1)^(2)*r1)/(1)+(gcd(2,2)^(2)*r2)/(2)+(gcd(2,4)^(2)*r4)/(4)+(gcd(2,5)^(2)*r5)/(5)+(gcd(2,8)^(2)*r8)/(8)+(gcd(2,10)^(2)*r10)/(10)+(gcd(2,20)^(2)*r20)/(20)+(gcd(2,40)^(2)*r40)/(40)>0) and ((gcd(4,1)^(2)*r1)/(1)+(gcd(4,2)^(2)*r2)/(2)+(gcd(4,4)^(2)*r4)/(4)+(gcd(4,5)^(2)*r5)/(5)+(gcd(4,8)^(2)*r8)/(8)+(gcd(4,10)^(2)*r10)/(10)+(gcd(4,20)^(2)*r20)/(20)+(gcd(4,40)^(2)*r40)/(40)>0) and ((gcd(5,1)^(2)*r1)/(1)+(gcd(5,2)^(2)*r2)/(2)+(gcd(5,4)^(2)*r4)/(4)+(gcd(5,5)^(2)*r5)/(5)+(gcd(5,8)^(2)*r8)/(8)+(gcd(5,10)^(2)*r10)/(10)+(gcd(5,20)^(2)*r20)/(20)+(gcd(5,40)^(2)*r40)/(40)>0) and ((gcd(8,1)^(2)*r1)/(1)+(gcd(8,2)^(2)*r2)/(2)+(gcd(8,4)^(2)*r4)/(4)+(gcd(8,5)^(2)*r5)/(5)+(gcd(8,8)^(2)*r8)/(8)+(gcd(8,10)^(2)*r10)/(10)+(gcd(8,20)^(2)*r20)/(20)+(gcd(8,40)^(2)*r40)/(40)>0) and ((gcd(10,1)^(2)*r1)/(1)+(gcd(10,2)^(2)*r2)/(2)+(gcd(10,4)^(2)*r4)/(4)+(gcd(10,5)^(2)*r5)/(5)+(gcd(10,8)^(2)*r8)/(8)+(gcd(10,10)^(2)*r10)/(10)+(gcd(10,20)^(2)*r20)/(20)+(gcd(10,40)^(2)*r40)/(40)>0) and ((gcd(20,1)^(2)*r1)/(1)+(gcd(20,2)^(2)*r2)/(2)+(gcd(20,4)^(2)*r4)/(4)+(gcd(20,5)^(2)*r5)/(5)+(gcd(20,8)^(2)*r8)/(8)+(gcd(20,10)^(2)*r10)/(10)+(gcd(20,20)^(2)*r20)/(20)+(gcd(20,40)^(2)*r40)/(40)>0) and ((gcd(40,1)^(2)*r1)/(1)+(gcd(40,2)^(2)*r2)/(2)+(gcd(40,4)^(2)*r4)/(4)+(gcd(40,5)^(2)*r5)/(5)+(gcd(40,8)^(2)*r8)/(8)+(gcd(40,10)^(2)*r10)/(10)+(gcd(40,20)^(2)*r20)/(20)+(gcd(40,40)^(2)*r40)/(40)>0 ) then (print(`f(q) is in Sk with the following r values`,rlist)) end if: end if: end if: end if: end do: end do: end do: end do: end do: end do: end do: end do: end proc;