login
Smallest prime p such that p+1 starts a run of exactly n consecutive numbers having exactly the same number of divisors.
0

%I #50 Mar 27 2026 00:21:20

%S 13,229,241,13781,298693,80749767323

%N Smallest prime p such that p+1 starts a run of exactly n consecutive numbers having exactly the same number of divisors.

%e The 2 consecutive integers following the prime 13, namely [14, 15], all have the same number of divisors, namely 4; 16 has 5 divisors and no smaller integer following a prime displays this property, hence a(2) = 13.

%e The 3 consecutive integers following the prime 229, namely [230, 231, 232], all have the same number of divisors, namely 8; 233 has 2 divisors and no smaller integer following a prime displays this property, hence a(3) = 229.

%e a(5) = A119730(1).

%e a(6) = A119740(1).

%t a[n_]:=Module[{p=2},While[Length[Union[DivisorSigma[0,Range[p+1,p+n]]]]>1,p=NextPrime[p]];p];Array[a,5,2] (* _James C. McMahon_, Mar 26 2026 *)

%o (PARI) card(k)=my(n=numdiv(k+1),i=1);while(numdiv(k+i+1)==n, i++);i

%o a(n)=forprime(p=2,+oo,if(card(p)==n,return(p)))

%Y Cf. A119711, A119728, A119730, A119740.

%Y Cf. A005237, A006601, A006558, A049051, A049052, A049053.

%Y Cf. A067889, A391384.

%K nonn,hard,more

%O 2,1

%A _Jean-Marc Rebert_, Feb 21 2026