A358656 Least prime p such that p^n + 2 is the product of n distinct primes.
3, 2, 7, 71, 241, 83, 157, 6947, 4231, 35509, 15541, 199499, 649147
Offset: 1
Examples
a(1) = 3; 3^1 + 2 = 5. a(2) = 2; 2^2 + 2 = 2 * 3. a(3) = 7; 7^3 + 2 = 3 * 5 * 23. a(4) = 71; 71^4 + 2 = 3 * 11 * 19 * 40529.
Programs
-
Mathematica
Table[b=2;y[a_]:=FactorInteger[Prime[a]^n+b];k=1;Monitor[Parallelize[While[True,If[And[Length[y[k]]==n,Count[Flatten[y[k]],1]==n],Break[]];k++];k],k]//Prime,{n,1,10}]
-
PARI
a(n) = forprime(p=2, , my(f=factor(p^n + 2)); if (issquarefree(f) && (omega(f) == n), return(p))); \\ Michel Marcus, Nov 29 2022
Extensions
a(13) from Daniel Suteu, Dec 09 2022
Comments