Question: nested if statements

Question:nested if statements

GPY 80 Maple

I have the following construct:
for i from 1 to 10 do
cubeprod:=i^3;
if irem(cubeprod,3)=0  and if(modp(cubeprod,2)<>0 then
cubesum(cubeprod);// I need both if statements to be true in order to invoke cubesum(). I've noticed that using an and between both if statements is incorrect but :

for i from 1 to 10 do
cubeprod:=i^3;
if irem(cubeprod,3)=0 then 
 if modp(cubeprod,2)<>0 then cubesum(cubeprod) fi;
end if;
end do;

gives me an error as well. What is the right syntax to achieve this?

Please Wait...