cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A135311 A greedy sequence of prime offsets.

This page as a plain text file.
%I A135311 #56 Feb 16 2025 08:33:07
%S A135311 0,2,6,8,12,18,20,26,30,32,36,42,48,50,56,62,68,72,78,86,90,96,98,102,
%T A135311 110,116,120,128,132,138,140,146,152,156,158,162,168,176,182,186,188,
%U A135311 198,200,210,212,216,230,240,242,246,252,260,266,270,272,278,282
%N A135311 A greedy sequence of prime offsets.
%C A135311 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.
%C A135311 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), ...
%C A135311 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.
%H A135311 Alessandro Languasco, <a href="/A135311/b135311.txt">Table of n, a(n) for n = 1..2089</a>
%H A135311 Thomas J. Engelsma, <a href="http://www.opertech.com/primes/k-tuples.html">K-Tuple Permissible Patterns</a>.
%H A135311 Anthony D. Forbes, <a href="http://anthony.d.forbes.googlepages.com/ktuplets.htm">Prime k-tuplets</a>.
%H A135311 Kevin Ford, Florian Luca and Pieter Moree, <a href="http://arxiv.org/abs/1108.3805">Values of the Euler phi-function not divisible by a given odd prime, and the distribution of Euler-Kronecker constants for cyclotomic fields</a>, arXiv preprint arXiv:1108.3805 [math.NT], 2011.
%H A135311 Alessandro Languasco, <a href="https://dx.doi.org/10.1007/s40993-020-00213-1">Efficient computation of the Euler-Kronecker constants of prime cyclotomic fields</a>, Research in Number Theory, 7, 2021, paper n. 2 (<a href="https://arxiv.org/abs/1903.05487">preliminary version</a>, arXiv:1903.05487 [math.NT], 2019-2020).
%H A135311 Alessandro Languasco, Pieter Moree, Sumaia Saad Eddin, and Alisa Sedunova, <a href="https://arxiv.org/abs/1908.01152">Computation of the Kummer ratio of the class number for prime cyclotomic fields</a>, arXiv:1908.01152 [math.NT], 2019.
%H A135311 Pieter Moree, <a href="https://arxiv.org/abs/1711.07996">Irregular behaviour of class numbers and Euler-Kronecker constants of cyclotomic fields: the log log log devil at play</a>, arXiv:1711.07996 [math.NT], 2017. Mentions this sequence.
%H A135311 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeConstellation.html">Prime Constellation</a>
%H A135311 Wikipedia, <a href="http://en.wikipedia.org/wiki/Schinzel&#39;s_hypothesis_H">Schinzel's hypothesis H</a>.
%e A135311 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.
%t A135311 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]]]]
%o A135311 (PARI)  {greedy()=local(A, L, B, n, v , ok , R, setR, p, k);
%o A135311 A=vector(2089); \\ 2089 is the length to get Sum_{i>=2}(1/A[i])>2; see Ford, Luca, Moree paper, p. 1454
%o A135311 L=length(A); B = 10^(5); \\ upper bound for the number of primes used; enough for the first 2089 terms
%o A135311 A[1]=0;  \\ first trivial term;
%o A135311 for (n=2, L,
%o A135311 R=vector(n);
%o A135311 forstep (v=A[n-1]+2, B, 2 , ok=1;
%o A135311 forprime(p = 2, v,
%o A135311 for(k=1,n-1, R[k]=A[k]%p);
%o A135311 R[n]=v%p;
%o A135311 setR=Set(R);
%o A135311 if (length(setR) > p-1, ok=0; break);  \\ v is not good
%o A135311 );
%o A135311 if (ok==1, A[n]=v; break);
%o A135311 );
%o A135311 );
%o A135311 return(A)
%o A135311 } \\ _Alessandro Languasco_, Aug 11 2019
%Y A135311 Cf. A008407, A020497.
%K A135311 nonn
%O A135311 1,2
%A A135311 galathaea(AT)gmail.com, Dec 07 2007
%E A135311 Edited by _Dean Hickerson_, Dec 07 2007