A252503 Smallest prime p such that Phi_n(p) is also prime, where Phi is the cyclotomic polynomial, or 0 if no such p exists.
3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 7, 2, 11, 3, 2, 113, 2, 43, 2, 2, 5, 151, 2, 2, 2, 2, 2, 179, 3, 61, 2, 23, 2, 53, 2, 89, 137, 11, 2, 5, 5, 2, 7, 73, 11, 307, 7, 7, 2, 5, 7, 19, 3, 2, 2, 3, 0, 2, 53, 491, 197, 2, 3, 3, 3, 11, 19, 59, 7, 2, 2, 271, 2, 191, 61, 41, 7, 2, 2, 59, 5, 2, 2
Offset: 1
Keywords
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1300 (first 1000 terms from Charles R Greathouse IV)
Programs
-
Mathematica
Do[n=1; p=Prime[n]; cp=Cyclotomic[k, p]; While[!PrimeQ[cp], n=n+1; p=Prime[n]; cp=Cyclotomic[k, p]]; Print[p], {k, 1, 300}]
-
PARI
a(n)=if(n>>valuation(n,2)==1 && n>32, if(ispseudoprime(2^(n/2)+1), 2, 0), my(P=polcyclo(n)); forprime(p=2,, if(ispseudoprime(subst(P,'x,p)), return(p)))) \\ Charles R Greathouse IV, Dec 18 2014
Comments