a(n)=for(k=1,5000,if(ispseudoprime((n-1)*n^k-1),print1(k, ", "))) b(n)=for(k=1,5000,if(ispseudoprime((n-1)*n^k+1),print1(k, ", "))) c(n)=for(k=1,5000,if(ispseudoprime((n+1)*n^k-1),print1(k, ", "))) d(n)=for(k=1,5000,if(ispseudoprime((n+1)*n^k+1),print1(k, ", "))) e(n)=for(k=1,5000,if(ispseudoprime(n^k-(n-1)),print1(k, ", "))) f(n)=for(k=1,5000,if(ispseudoprime(n^k+(n-1)),print1(k, ", "))) g(n)=for(k=1,5000,if(ispseudoprime(n^k-(n+1)),print1(k, ", "))) h(n)=for(k=1,5000,if(ispseudoprime(n^k+(n+1)),print1(k, ", "))) z(n,k)=if(k==1,a(n),if(k==2,b(n),if(k==3,c(n),if(k==4,d(n),if(k==5,e(n),if(k==6,f(n),if(k==7,g(n),if(k==8,h(n))))))))) for(n=2,1024,for(k=1,8,if(n%3 != 1 || k%4 != 0,print1(n, ", ", k, ["st","nd","rd","th","th","th","th","th"][k], ": ");z(n,k);print())))