A362239 Primes such that all composite numbers up to the next prime have the same number of distinct prime divisors.
2, 3, 5, 11, 17, 19, 29, 37, 41, 43, 53, 59, 71, 97, 101, 107, 137, 149, 157, 179, 191, 197, 223, 227, 239, 269, 281, 311, 347, 419, 431, 461, 499, 521, 569, 599, 617, 641, 643, 659, 673, 739, 809, 821, 827, 857, 881, 1019, 1031, 1049, 1061, 1091, 1151
Offset: 1
Keywords
Examples
19 is a term because 19 is a prime and each of the composite numbers up to the next prime (20, 21, and 22) has exactly 2 distinct prime divisors.
Programs
-
Mathematica
q[p_] := Length[Union[Table[PrimeNu[c], {c, Range[p + 1, NextPrime[p] - 1]}]]] <= 1; Select[Prime[Range[200]], q] (* Amiram Eldar, May 18 2023 *)
-
PARI
isok(p)=if(isprime(p), my(q=nextprime(p+1), t=omega(p+1)); for(i=p+2, q-1, if(omega(i)<>t, return(0))); 1, 0) \\ Andrew Howroyd, Apr 12 2023
Extensions
More terms from Andrew Howroyd, Apr 12 2023