A333779 Positive numbers m used to build entire prime set by m +/- n without duplication or 0 if there is no such m.
2, 4, 9, 16, 27, 42, 23, 60, 51, 70, 93, 120, 85, 114, 153, 56, 165, 174, 155, 132, 213, 218, 201, 234, 253, 288, 225, 254, 135, 360, 323, 342, 315, 274, 303, 384, 395, 420, 405, 440, 357, 420, 481, 534, 465, 454
Offset: 0
Keywords
Examples
a(0)=2, because 2=2+0=2-0 and 2 is prime. a(1)=4, because 3=4-1, 5=4+1, both 3 and 5 are primes, not covered yet. a(1) is not 3 because 3+1=4 is not a prime number. a(2)=9, because 7=9-2, 11=9+2, both 7 and 11 are primes, not covered yet. a(2) is not 5 (although 5-2=3 and 5+2=7, both are primes) because 3 is already covered by a term a(1) - this sequence is without duplication.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Marcin Barylski, C++ program for generating A333779
- Marcin Barylski, On the symmetry of primes
Programs
-
Mathematica
Nest[Function[{t, i}, Append[t, Block[{k = 2, s}, While[! AllTrue[Set[s, k + i {-1, 1}], And[PrimeQ@ #, FreeQ[t[[All, -1]], #] ] &], k++]; {k, s}] ]] @@ {#, Length@ #} &, {{2, {2}}}, 60][[All, 1]] (* Michael De Vlieger, May 03 2020 *)
-
PARI
{ p=2; pp=[]; for (n=0, 45, for (k=1, oo, while (#pp
pp[#pp], pp = concat(pp, p); p = nextprime(p+1);); if (setsearch(pp, pp[k]+2*n), print1 (pp[k]+n", "); pp = setminus(pp, Set([pp[k], pp[k]+2*n])); break))) } \\ Rémy Sigrist, Jun 06 2020
Extensions
More terms from Michael De Vlieger, May 03 2020
Comments