I would like to implement the Pollard p-1 algorithm in Pari/GP but I failed. Here is my code. I am confused with when should I use "," and when should I use ";" in for loop and if statement.
n=2993
b=2
maxk=100
for(i=1,maxk,b=Mod(b^i,n);if(Mod(i,10)==0,g=gcd(b-1,n );if(g>1,print(g),break));print("1"))

a=0; for(i=1,N,{ a = a*i; print(i); if (a > 10, {print(a); break;})});$\endgroup$