OFFSET
2,1
COMMENTS
Based on but not identical to Erdős Problem 854 (see link).
LINKS
Thomas Bloom, Problem 854, Erdős Problems.
EXAMPLE
For n=2, a(2)=2 since the only numbers (bounded by 6) relative prime with p(2)# = 3# = 6 are 1 and 5, and 2 is not the difference of them.
For n=3, a(3)=14, since the numbers relatively prime to and bounded by p(3)# = 30 are in the set [1, 7, 11, 13, 17, 19, 23, 29]. Now 19-17=2, 17-13=4, 23-17=6, 19-11=8, 29-19=10 and 29-17=12, but no two elements differ by 14 (nor 20, 24 or 26).
PROG
(SageMath)
def a(n):
N=prod(Primes()[0:n]);
R=[a for a in range(1, N) if gcd(N, a)==1];
D=[j-i for (i, j) in Combinations(R, 2)];
return min([i for i in range(2, N, 2) if i not in D]);
(PARI) a(n) = my(P=vecprod(primes(n)), v=select(x->(gcd(x, P)==1), [1..P]), list=List(), vs=[]); for (i=1, #v, for (j=i+1, #v, my(x=v[j]-v[i]); if (!vecsearch(vs, x), listput(list, x); vs = vecsort(list)); ); ); my(s=Set(list)); for (k=1, vecmax(v), if (!setsearch(s, 2*k), return(2*k)); ); \\ Michel Marcus, Oct 09 2025
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Stijn Cambie, Oct 07 2025
EXTENSIONS
a(7) from Michel Marcus, Oct 10 2025
a(8)-a(10) from Sean A. Irvine, Oct 14 2025
STATUS
approved
