OFFSET
1,1
COMMENTS
If p and q are twin primes and p<q, then the interval (p, q) contains an integer whose least prime factor is greater than or equal to the length of the prime gap (p, q): indeed, the least prime factor of p+1 is greater than or equal to 2 whereas the length of the gap is q-p=2.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Thomas Bloom, Problem 682, Erdős Problems.
Erdős problems database contributors, Erdős problem database, see no. 682.
Ayla Gafni and Terence Tao, Rough numbers between consecutive primes, arXiv:2508.06463 [math.NT] (2025).
EXAMPLE
1 does not belong to this sequence because the first prime gap is (2,3). The second prime gap is (3,5); since the length of this interval is 5-3=2 and 4 belongs to it, we have that 2 is the first term of the sequence.
MAPLE
q:= k-> ((p, r)-> ormap(f-> min(ifactors(f)[2][..., 1])>=
r-p, [$p+1..r-1]))((map(ithprime, [k, k+1])[])):
select(q, [$1..123])[]; # Alois P. Heinz, Aug 12 2025
MATHEMATICA
For[n = 1, n <= 200, n++, k = Prime[n];
count = 0;
While[k < Prime[n+1], If[FactorInteger[k][[1, 1]] < Prime[n+1] - Prime[n], count = count+1]; k++; ];
If[count == Prime[n+1] - Prime[n] - 1, , Print[n]]]
(* This code outputs all the terms of the sequence in the interval [1, 200]. *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
José Hernández, Aug 11 2025
STATUS
approved
