A343729 a(n) is the smallest number that starts a run of exactly n consecutive integers that are neither primes nor semiprimes.
8, 27, 98, 342, 242, 6092, 3174, 2870, 2522, 16023, 26604, 114359, 41780, 74492, 39344, 463162, 104660, 248408, 517422, 923723, 506510, 1930824, 584214, 2560178, 4036968, 4570412, 4552364, 7879254, 4417814, 27841052, 5167588, 13683035, 9725108, 47735343
Offset: 1
Keywords
Examples
a(5) = 242 because 241 is a prime, 247=13*19 is a semiprime, none of the 5 consecutive integers between them are primes or semiprimes (242 = 2*11^2, 243 = 3^5, 244 = 2^2*61, 245 = 5*7^2, and 246 = 2*3*41), and there is no smaller run of exactly 5 consecutive integers that are neither prime nor semiprime.
Programs
-
Mathematica
Module[{nn=48*10^6,lst},lst=Table[Which[PrimeQ[n],1,PrimeOmega[n]==2,1,True,0],{n,nn}]; Flatten[Table[SequencePosition[lst,Join[{1},PadRight[{},n,0],{1}],1],{n,34}],1]][[;;,1]]+1 (* Harvey P. Dale, May 30 2024 *)
Extensions
Corrected by Harvey P. Dale, May 30 2024