OFFSET
1,2
COMMENTS
Given a(i) for 1 <= i < n, a(n) is the smallest number > a(n-1) such that, for every prime p, the set {a(i) mod p : 1<=i<=n} has at most p-1 elements. Assuming Schinzel's hypothesis H, an equivalent statement is that a(n) is minimal such that there are infinitely many primes p with p+a(i) prime for 1 <= i <= n.
For every n, a(n) is not congruent to 1 (mod 2), nor to 1 (mod 3), nor to 4 (mod 5), nor to 3 (mod 7), ...
Note that this sequence does not always give the minimal difference between the first and last of n consecutive large primes, A008407. E.g., a(6)=18 but the 6 consecutive primes 97, 101, 103, 107, 109, 113 give the minimal difference of 16.
LINKS
Alessandro Languasco, Table of n, a(n) for n = 1..2089
Thomas J. Engelsma, K-Tuple Permissible Patterns.
Anthony D. Forbes, Prime k-tuplets.
Kevin Ford, Florian Luca and Pieter Moree, Values of the Euler phi-function not divisible by a given odd prime, and the distribution of Euler-Kronecker constants for cyclotomic fields, arXiv preprint arXiv:1108.3805 [math.NT], 2011.
Alessandro Languasco, Efficient computation of the Euler-Kronecker constants of prime cyclotomic fields, Research in Number Theory, 7, 2021, paper n. 2 (preliminary version, arXiv:1903.05487 [math.NT], 2019-2020).
Alessandro Languasco, Pieter Moree, Sumaia Saad Eddin, and Alisa Sedunova, Computation of the Kummer ratio of the class number for prime cyclotomic fields, arXiv:1908.01152 [math.NT], 2019.
Pieter Moree, Irregular behaviour of class numbers and Euler-Kronecker constants of cyclotomic fields: the log log log devil at play, arXiv:1711.07996 [math.NT], 2017. Mentions this sequence.
Eric Weisstein's World of Mathematics, Prime Constellation
Wikipedia, Schinzel's hypothesis H.
EXAMPLE
Given a(1) through a(5), a(6) can't be 14 since the set {0,2,6,8,12,14} contains elements from every residue class (mod 5). a(6) can't be 16 because {0,2,6,8,12,16} contains elements from every residue class (mod 3). a(6)=18 is possible, since the residues (mod 2) are all 0, the residues (mod 3) are all 0 or 2 and the residues (mod 5) are all 0, 1, 2, or 3.
MATHEMATICA
a[1]=0; a[n_]:=a[n]=Module[{v, set, ok, p}, For[v=a[n-1]+2, True, v+=2, set=Append[a/@Range[n-1], v]; For[p=3; ok=True, p<=n, p+=2, If[PrimeQ[p]&&Length[Union[Mod[set, p]]]==p, ok=False; Break[]]]; If[ok, Return[v]]]]
PROG
(PARI) {greedy()=local(A, L, B, n, v , ok , R, setR, p, k);
A=vector(2089); \\ 2089 is the length to get Sum_{i>=2}(1/A[i])>2; see Ford, Luca, Moree paper, p. 1454
L=length(A); B = 10^(5); \\ upper bound for the number of primes used; enough for the first 2089 terms
A[1]=0; \\ first trivial term;
for (n=2, L,
R=vector(n);
forstep (v=A[n-1]+2, B, 2 , ok=1;
forprime(p = 2, v,
for(k=1, n-1, R[k]=A[k]%p);
R[n]=v%p;
setR=Set(R);
if (length(setR) > p-1, ok=0; break); \\ v is not good
);
if (ok==1, A[n]=v; break);
);
);
return(A)
} \\ Alessandro Languasco, Aug 11 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
galathaea(AT)gmail.com, Dec 07 2007
EXTENSIONS
Edited by Dean Hickerson, Dec 07 2007
STATUS
approved