login
Primes such that all composite numbers up to the next prime have the same number of distinct prime divisors.
0

%I #21 May 18 2023 23:26:38

%S 2,3,5,11,17,19,29,37,41,43,53,59,71,97,101,107,137,149,157,179,191,

%T 197,223,227,239,269,281,311,347,419,431,461,499,521,569,599,617,641,

%U 643,659,673,739,809,821,827,857,881,1019,1031,1049,1061,1091,1151

%N Primes such that all composite numbers up to the next prime have the same number of distinct prime divisors.

%e 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.

%t 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 *)

%o (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

%Y A001359 is a subsequence.

%Y Cf. A001221 (omega).

%K nonn

%O 1,1

%A _Mike Jones_, Apr 12 2023

%E More terms from _Andrew Howroyd_, Apr 12 2023