{sphen105 = [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, 3, 6, 4, 2, 4, 5, 2, 6, 1, 1, 4, 6, 1, 6, 1, 2, 3, 2, 4, 6, 3, 3, 1, 6, 3, 3, 3, 1, 3, 1, 5, 3, 1];} {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(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 = [6056631147836384707, 36280800841219046527, 2324181140373856512365629, 179419348960533709684359377, 7189499393185222203667944953, 13183757642854022277502039783, 16475622452074251276738202929289, 3872396209829399608824460813684394960688524987];} if(isprime(help)==vector(#help,k,1),addprimes(help)); ischain(sphen105);print(round(gettime/10^3)" seconds");