{sphen109 = [114, 3, 6, 6, 3, 2, 2, 4, 4, 3, 4, 1, 6, 1, 4, 1, 3, 2, 3, 2, 6, 1, 6, 3, 5, 5, 6, 2, 1, 6, 6, 6, 1, 2, 5, 4, 3, 5, 2, 5, 2, 4, 1, 5, 1, 6, 5, 3, 3, 5, 5, 2, 1, 5, 5, 1, 6, 4, 5, 5, 3, 5, 2, 4, 4, 4, 3, 4, 5, 6, 4, 6, 5, 6, 2, 1, 1, 6, 6, 5, 6, 6, 4, 6, 6, 2, 4, 4, 6, 6, 2, 5, 3, 1, 2, 2, 1, 2, 2, 4, 3, 1, 4, 3, 1, 2, 5, 3, 5];} {ischain(s)=local(f,n=s[1],P,t); P=[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]; for(k=1,#s,print1(k": ");n=eval(n);f=factor(n)[,1]; if(#f<3||n!=f[1]*f[2]*f[3],print("fail");break(), if(k==#s,print(n" has factors "f~),print1(n " = "); n="";for(j=1,3,t=f[P[s[k+1]][j]];print1(t); if(j<3,print1("*"),print());n=concat(n,t)))));} {help=[7077008548311281,61103300985260311031,78242843819901342163, 1033124863700067932389,1779194782522581654749,2385909688662241092248861, 1432000316136853938371539073069,1909949048655746953407577675529, 3593746232796852294559702508509,1261581310526717265151139363862888703, 42324013237813338890527918505795922784492603];} if(isprime(help)==vector(#help,k,1),addprimes(help)); ischain(sphen109);print(round(gettime/10^3)" seconds");