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.

Showing 1-10 of 28 results. Next

A329333 There is exactly one odd prime among the pairwise sums of any three consecutive terms: Lexicographically earliest sequence of distinct nonnegative integers with this property.

Original entry on oeis.org

0, 1, 2, 7, 3, 6, 4, 5, 8, 10, 11, 9, 12, 14, 15, 13, 18, 17, 19, 20, 21, 24, 16, 23, 25, 22, 26, 27, 28, 31, 29, 32, 33, 34, 30, 39, 37, 36, 38, 41, 40, 42, 43, 46, 35, 44, 47, 45, 50, 51, 48, 49, 56, 52, 53, 54, 57, 55, 58, 59, 68, 60, 63, 64, 61, 66, 62, 69, 67, 72, 71, 65, 74, 70, 75, 76, 77
Offset: 0

Views

Author

Keywords

Comments

This is conjectured and designed to be a permutation of the nonnegative integers, therefore the offset is taken to be zero.
Restricted to positive indices, this is a sequence of positive integers having the same property, then conjectured to be a permutation of the positive integers. (The word "odd" can be omitted in this case.)
If the word "odd" is dropped from the original definition, the sequence starts (0, 1, 3, 6, 2, 7), and then continues from a(6) = 4 onward as the present sequence. This is again conjectured to be a permutation of the nonnegative integers, and a permutation of the positive integers when restricted to the domain [1..oo). The latter however no longer has the property of lexicographic minimality.
See the OEIS wiki page for further considerations about existence, surjectivity and variants. - M. F. Hasler, Nov 24 2019

Examples

			For the first two terms there is no restriction regarding primality, so a(0) = 0, a(1) = 1. (If only positive values and indices are considered, then a(1) = 1 and a(2) = 2.)
Then a(2) must be such that among { 0+1, 0+a(2), 1+a(2) } there is exactly one odd prime, and 2 works.
Then a(3) must be such that among { 1+2, 1+a(3), 2+a(3) } there is only one (odd) prime. Since 1+2 = 3, the other two sums must both yield a composite. This excludes 3, 4, 5 and 6 and the smallest possibility is a(3) = 7.
And so on.
		

Crossrefs

For the primes that arise, or are missing, see A328997, A328998.
See A329450 for the variant having 0 primes among a(n+i) + a(n+j), 0 <= i < j < 3.
See A329452 for the variant having 2 primes among a(n+i) + a(n+j), 0 <= i < j < 4.
A084937, A305369 have comparable conditions on three consecutive terms.

Programs

  • Mathematica
    a[0]=0;a[1]=1;a[2]=2;a[n_]:=a[n]=(k=1;While[Length@Select[Plus@@@Subsets[{a[n-1],a[n-2],++k},{2}],PrimeQ]!=1||MemberQ[Array[a,n-1,0],k]];k);Array[a,100,0] (* Giorgos Kalogeropoulos, May 07 2021 *)
  • PARI
    A329333(n,show=0,o=0,p=0,U=[])={for(n=o,n-1, show&&print1(o","); U=setunion(U,[o]); while(#U>1&&U[1]==U[2]-1,U=U[^1]); for(k=U[1]+1,oo, setsearch(U,k)|| if(isprime(o+p), isprime(o+k)|| isprime(p+k), isprime(o+k)==isprime(p+k)&&p)||[o&&p=o, o=k, break]));o} \\ Optional args: show = 1: print all values up to a(n); o = 1: start with a(1) = 1; p = 1: compute the variant with a(2) = 3. See the wiki page for more general code which returns the whole vector: Use S(n_max,1,3,1) or S(n_max,1,3,2,[0,1]); S(n_max,1,3,0) gives the variant (0, 1, 3, ...)

Extensions

Entry revised by N. J. A. Sloane, Nov 14 2019 and M. F. Hasler, Nov 15 2019

A329405 Among the pairwise sums of any three consecutive terms there is no prime: lexicographically earliest such sequence of distinct positive integers.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 14, 2, 4, 6, 8, 10, 12, 15, 18, 17, 16, 19, 20, 25, 24, 21, 27, 23, 22, 26, 28, 29, 34, 31, 32, 33, 30, 35, 39, 37, 38, 40, 36, 41, 44, 43, 42, 45, 46, 47, 48, 51, 54, 57, 58, 53, 52, 59, 56, 49, 50, 55, 60, 61, 62, 63, 66, 67, 68, 65, 64, 69, 71, 72, 70, 73, 74, 79, 76, 77, 78
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 13 2019

Keywords

Comments

Conjectured to be a permutation of the positive integers.
From M. F. Hasler, Nov 14 2019: (Start)
Equivalently: For any n, neither a(n) + a(n+1) nor a(n) + a(n+2) is prime. Or: For any n and 0 <= i < j <= 2, a(n+i) + a(n+j) is never prime.
See A329450, A329452 onward and the wiki page for variants and further considerations about existence, surjectivity, etc. of such sequences. (End)

Examples

			a(1) = 1 from minimality.
a(2) = 3 since 2 would produce 3 (a prime) by making 1 + 2.
a(3) = 5 since 2 or 4 would produce a prime (e.g., 3 + 4 = 7).
a(4) = 7 since 2, 4 or 6 would produce a prime (e.g., 5 + 6 = 11).
...
a(8) = 14 as 2, 4, 6, 8, 10 or 12 would produce a prime together with a(7) = 13 or a(6) = 11.
a(9) = 2 as neither 2 + 13 = 15 nor 2 + 14 = 16 is prime.
And so on.
		

Crossrefs

Cf. A329333 (3 consecutive terms, exactly 1 prime sum).
Cf. A329406 .. A329410 (exactly 1 prime sum using 4, ..., 10 consecutive terms).
Cf. A329411 .. A329416 (exactly 2 prime sums using 3, ..., 10 consecutive terms).
See also A329450, A329452 onwards for "nonnegative" variants.

Programs

  • Mathematica
    a[1]=1;a[2]=3;a[n_]:=a[n]=(k=1;While[Or@@PrimeQ[Plus@@@Subsets[{a[n-1],a[n-2],++k},{2}]]||MemberQ[Array[a,n-1],k]];k);Array[a,100] (* Giorgos Kalogeropoulos, May 09 2021 *)
  • PARI
    A329405(n, show=1, o=1, p=o, U=[])={for(n=o, n-1, show&&print1(p", "); U=setunion(U, [p]); while(#U>1&&U[1]==U[2]-1, U=U[^1]); for(k=U[1]+1, oo, setsearch(U, k) || isprime(o+k) || isprime(p+k) || [o=p, p=k, break])); p} \\ Optional args: show=0: don't print the list; o=0: start with a(0) = 0, i.e., compute A329450. See the wiki page for more general code returning a vector: S(n,0,3,1) = a(1..n).

Extensions

Edited by N. J. A. Sloane, Nov 15 2019

A329449 For any n >= 0, exactly four sums a(n+i) + a(n+j) are prime, for 0 <= i < j <= 3: lexicographically earliest such sequence of distinct nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 9, 8, 15, 14, 5, 26, 17, 6, 11, 12, 7, 30, 29, 24, 13, 18, 19, 10, 43, 28, 31, 16, 25, 22, 21, 46, 37, 52, 27, 34, 45, 44, 39, 58, 69, 20, 51, 32, 41, 38, 35, 48, 23, 36, 53, 50, 47, 54, 59, 42, 55, 72, 65, 84, 67, 114, 79, 60, 49, 78, 71, 102, 61, 66, 91, 40, 73, 76, 33, 64, 63, 68
Offset: 0

Views

Author

M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019

Keywords

Comments

That is, there are exactly four primes (counted with multiplicity) among the 6 pairwise sums of any four consecutive terms. This is the theoretical maximum: there can't be a sequence with more than 4 prime sums in any 4 consecutive terms, see the wiki page for details.
This map is defined with offset 0 as to have a permutation of the nonnegative integers in case each of these eventually appears, which is so far only conjectured, see below. The restriction to positive indices would then be a permutation of the positive integers, and as it happens, also the smallest one with the given property. (This is in contrast to most other cases where that one is not the restriction of the other one: see crossrefs).
Concerning the existence of the sequence with infinite length: If the sequence is to be computed in a greedy manner, this means that for given P(n) := {a(n-1), a(n-2), a(n-3)} and thus 0 <= N(n) := #{ primes x + y with x, y in P(n), x < y} <= 4, we have to find a(n) such that we have exactly 4 - N(n) primes in a(n) + N(n). It is easy to prove that this is always possible when 4 - N(n) = 0 or 1. Otherwise, similar to A329452, ..., A329456, we see that P(n) is an "admissible constellation" in the sense that a(n-4) + P(n) already gave the number of primes required now. So a weaker variant of the k-tuple conjecture would ensure we can find this a(n). But the sequence need not be computable in greedy manner! That is, if ever for given P(n) no a(n) would exist such that a(n) + P(n) contains 4 - N(n) primes, this simply means that the considered value of a(n-1) (and possibly a(n-2)) was incorrect, and the next larger choice has to be made. Given this freedom, there is no doubt that this sequence is well defined up to infinity.
Concerning surjectivity: If a number m would never appear, this means that m + P(n) will never have the required number of 4 - N(n) primes for all n with a(n) > m, in spite of having found for each of these n at least two other solutions, a(n-4) + P(n) and a(n) + P(n) which both gave 4 - N(n) primes. This appears extremely unlikely and thus as strong evidence in favor of surjectivity.
See examples for further computational evidence.

Examples

			We start with a(0) = 0, a(1) = 1, a(2) = 2, a(3) = 3, the smallest possibilities which do not lead to a contradiction. Indeed, the four sums 0 + 2, 0 + 3, 1 + 2 and 2 + 3 are prime.
Now we have 2 prime sums using {1, 2, 3}, so the next term must give two more prime when added to these. We find that a(4) = 4 is the smallest possible choice, with 1 + 4 = 5 and 3 + 4 = 7.
Then there are again 2 primes among the pairwise sums using {2, 3, 4}, so the next term must again produce two more prime sums. We find that a(5) = 9 is the smallest possibility, with 2 + 9 = 11 and 4 + 9 = 13.
a(10^4) = 9834 and all numbers up to 9834 occurred by then.
a(10^5) = 99840 and all numbers below 99777 occurred by then.
a(10^6) = 1000144 and all numbers below 999402 occurred by then.
		

Crossrefs

Other sequences with N primes among pairwise sums of M consecutive terms, starting with a(o) = o, sorted by decreasing N and lowest possible M: A329581 (N=11, M=8, o=0), A329580 (N=10, M=8, o=0), A329569 (N=9, M=6, o=0), A329568 (N=9, M=6, o=1), A329425 (N=6, M=5, o=0), A329449 (N=4, M=4, o=0), A329411 (N=2, M=3, o=0 or 1), A128280 (N=1, M=2, o=0), A055265 (N=1, M=2, o=1), A055266 (N=0, M=2; o=1), A253074 (N=0, M=2; o=0).
For other variants see A329333 (N=1, M=3; o=0/1), A329405 (0,3;1) .. A329417 (3,4;1), A329449 (4,4;0) .. A329580 (10,8;0).

Programs

  • PARI
    A329449(n, show=0, o=0, N=4, M=3, p=[], U, u=o)={for(n=o, n-1, if(show>0, print1(o", "), show<0, listput(L,o)); U+=1<<(o-u); U>>=-u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2, #p, sum(j=1, i-1, isprime(p[i]+p[j])))); for(k=u, oo, bittest(U, k-u) || min(c-#[0|p<-p, isprime(p+k)], #p>=M) || [o=k, break]));show&&print([u]); o} \\ Optional args: show=1: print a(o..n-1), show=-1: append a(o..n-1) to the global list L, in both cases print [least unused number] at the end; o=1: start with a(1)=1; N, M: get N primes using M+1 consecutive terms.

A329453 There are exactly two primes in {a(n+i) + a(n+j), 0 <= i < j <= 4} for any n: lexicographically earliest such sequence of distinct nonnegative integers.

Original entry on oeis.org

0, 1, 2, 8, 14, 4, 11, 6, 12, 10, 15, 5, 3, 7, 22, 9, 13, 17, 16, 18, 32, 21, 24, 20, 25, 19, 27, 23, 28, 26, 30, 29, 35, 34, 31, 36, 41, 33, 37, 40, 39, 45, 38, 42, 47, 43, 46, 44, 50, 54, 51, 49, 61, 53, 56, 57, 55, 59, 58, 68, 60, 48, 69, 62, 67, 64, 52, 63, 65, 66, 71, 70, 75, 73, 76, 72, 80, 78, 77, 81, 74
Offset: 0

Views

Author

M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019

Keywords

Comments

That is, there are exactly two primes among the 10 pairwise sums of any five consecutive terms.
Conjectured to be a permutation of the nonnegative numbers. (Therefore the offset is chosen to have a(0) = 0. The restriction to positive indices is then a permutation of the positive integers, but not the smallest one which is A329413, conjectured.)
a(10^6) = 1000009 and all numbers below 999993 have appeared at that point.
Concerning the existence of the sequence, if the sequence is to be computed in a greedy manner, this means the following: for given n, we assume given P(n) := {a(n-1), a(n-2), a(n-3), a(n-4)} and thus S(n) := #{ primes x + y with x, y in P(n), x < y} which may equal 0, 1 or 2. We have to find a(n) such that we have exactly 2 - S(n) primes in a(n) + P(n). It is easy to prove that this is possible when 2 - S(n) is 0 or 1. When S(n) = 0, we must find two primes which are at a distance of |x - y| for some x, y in P(n). This is much weaker than to require the existence of twin primes or cousin primes etc., generally believed to hold and in part proved under hypotheses weaker than RH: First, we have the choice of several distances. Second, we don't require that there be no other primes in between. But more than that, it is not at all needed that the sequence be computable in a greedy manner! I.e., in the extremely improbable event that for some n with S(n) = 0 there might be no a(n) such that a(n) + P(n) contains 2 primes, we have infinitely many other choices for a(n-1) or even a(n-2), etc.! Given this additional freedom, the existence of a(n) for any n is beyond any doubt (and maybe not even difficult to prove, by contradiction).
Concerning the conjecture that all numbers will eventually occur: if a number m never appears, this means that m + P(n) never has the required number of 2 - S(n) primes. That is, for all n such that S(n) = 2, the set m + P(n) has at least one prime, and whenever S(n) = 1, the set m + P(n) has never exactly 1 prime. Given that each of the sets P(n) contains 4 numbers which were chosen essentially independently of m, it appears extremely improbable that all these infinitely many constraints could hold simultaneously for any m. Computational results so far also give only strong evidence in favor of this conjecture.

Examples

			We start with a(0) = 0, a(1) = 1, a(2) = 2, the smallest possibilities which do not lead to a contradiction.
Now there are already 2 primes, 0 + 2 and 1 + 2, among the pairwise sums, so the next term must not generate any further prime. Given 0 and 1, primes and (primes - 1) are excluded, and a(3) = 8 is the smallest possible choice.
Then there are still two primes among the pairwise sums using {0, 1, 2, 8}: again, the next term must not produce any additional prime as sum with these. We find that a(4) = 14 is the smallest possibility.
		

Crossrefs

Cf. A329413 (analog for positive integers), A329452 (2 primes among a(n+i)+a(n+j), 0 <= i < j < 4).
Cf. A329333 (1 odd prime among a(n+i)+a(n+j), 0 <= i < j < 3), A329450 (no primes among a(n+i)+a(n+j), 0 <= i < j < 3).

Programs

  • PARI
    A329453(n, show=0, o=0, N=2, M=4, p=[], U, u=o)={for(n=o, n-1, show&& print1(o", "); U+=1<<(o-u); U>>=-u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2, #p, sum(j=1, i-1, isprime(p[i]+p[j])))); if(#pA329413), N, M: get N primes using M+1 consecutive terms.

A329411 Among the pairwise sums of any three consecutive terms there are exactly two prime sums: lexicographically earliest such sequence of distinct positive numbers.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 10, 13, 16, 15, 14, 17, 12, 11, 18, 19, 22, 21, 20, 23, 24, 29, 30, 31, 28, 25, 33, 34, 26, 27, 32, 35, 36, 37, 42, 41, 38, 45, 44, 39, 40, 43, 46, 51, 50, 47, 53, 54, 48, 49, 52, 55, 57, 82, 56, 75, 62, 64, 87, 63, 76, 61, 66, 65, 71, 86, 60, 77, 67, 72, 59, 68, 69, 58, 70
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 14 2019

Keywords

Comments

About existence of this (infinite) sequence: If it is computed in greedy manner, this means that for given n we are given P(n) := {a(n-1), a(n-2)} and have to find a(n) such that we have exactly 1 or 2 primes in a(n) + P(n) depending on whether a(n-1) + a(n-2) is prime or not. It is easy to prove that this is always possible in the first case (1 prime required). In the second case, we must find two larger primes at given distance |a(n-1) - a(n-2)|, necessarily even, since a(n-3) + P(n) contains two primes. To have this infinitely many times, the twin prime conjecture or a variant thereof must hold. However, the sequence need not be computable in greedy manner! That is, if ever for given P(n) (with composite sum) no a(n) would exist such that a(n) + P(n) contains 2 primes, this simply means that the considered value of a(n-1) was incorrect, and the next larger choice has to be made. Given this freedom, there is no doubt about well-definedness of this sequence up to infinity. - M. F. Hasler, Nov 14 2019, edited Nov 16 2019
Could be extended to a(0) = 0 to yield a sequence of nonnegative integers with the same property, including lexicographic minimality, which is a permutation of the nonnegative integers iff this sequence is a permutation of the positive integers.
This is the first known example where the restriction of S(N,M;0) to [1..oo) gives S(N,M;1), where S(N,M;o) is the lexicographically smallest sequence with a(o)=o, N primes among pairwise sums of M consecutive terms, and no duplicate terms: For example, S(0,3;1) = A329405 is not A329450\{0}, S(2,4;1) = A329412 is not A329452\{0}, etc. The second such example is S(4,4;o) = A329449. - M. F. Hasler, Nov 16 2019
Differs from A055265 from a(30) = 33 on. See the wiki page for further considerations and variants. - M. F. Hasler, Nov 24 2019

Examples

			a(1) = 1 is the smallest possible choice; there's no restriction on the first term.
a(2) = 2 as 2 is the smallest available integer not leading to a contradiction. Note that as 1 + 2 = 3 we already have one prime sum (out of the required two) with the pair {1, 2}.
a(3) = 3 as 3 is the smallest available integer not leading to a contradiction. Since 2 + 3 = 5 we now have our two prime sums with the triplet {1, 2, 3}.
a(4) = 4 as 4 is the smallest available integer not leading to a contradiction. Since 3 + 4 = 7 we now have our two prime sums with the triplet {2, 3, 4}: they are 2 + 3 = 5 and 3 + 4 = 7.
a(5) = 7 because 5 or 6 would lead to a contradiction: indeed, both the triplets {3, 4, 5} and {3, 4, 6} will produce only one prime sum (instead of two). With a(5) = 7 we have the triplet {3, 4, 7} and the two prime sums we were looking for: 3 + 4 = 7 and 4 + 7 = 11.
And so on.
		

Crossrefs

Cf. A055265 (sum of two consecutive terms is always prime: differs from a(30) on).
Cf. A329412 .. A329416 (exactly 2 prime sums using 4, ..., 10 consecutive terms).
Cf. A329333, A329406 .. A329410 (exactly 1 prime sum using 3, 4, ..., 10 consecutive terms).
Cf. A055266 (no prime sum among 2 consecutive terms), A329405 (no prime among the pairwise sums of 3 consecutive terms).
See also "nonnegative" variants: A253074, A329450 (0 primes using 2 resp. 3 terms), A128280 (1 prime from 2 terms), A329452, A329453 (2 primes from 4 resp. 5 terms), A329454, A329455 (3 primes from 4 resp. 5 terms), A329449, A329456 (4 primes from 4 resp. 5 terms). See the Wiki page for more.

Programs

  • Mathematica
    a[1]=1;a[2]=2;a[n_]:=a[n]=(k=1;While[Length@Select[Plus@@@Subsets[{a[n-1],a[n-2],++k},{2}],PrimeQ]!=2||MemberQ[Array[a,n-1],k]];k);Array[a,100] (* Giorgos Kalogeropoulos, May 09 2021 *)
  • PARI
    A329411(n,show=0,o=1,N=2,M=2,p=[],U,u=o)={for(n=o,n-1, show>0&& print1(o", "); show<0&& listput(L,o); U+=1<<(o-u); U>>=-u+u+=valuation(U+1,2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2,#p, sum(j=1,i-1, isprime(p[i]+p[j])))); for(k=u,oo, bittest(U,k-u)|| min(c-#[0|p<-p, isprime(p+k)], #p>=M) ||[o=k,break]));show&&print([u]);o} \\ Optional args: show=1: print a(o..n-1), show=-1: append a(o..n-1) to the (global) list L, in both cases print [least unused number] at the end; o=0: start with a(o)=o; N, M: find N primes using M+1 consecutive terms. - M. F. Hasler, Nov 16 2019

A329454 There are exactly three primes among a(n+i) + a(n+j), 0 <= i < j <= 3, for any n >= 0: lexicographically earliest such sequence of distinct nonnegative integers.

Original entry on oeis.org

0, 1, 2, 4, 5, 3, 8, 6, 11, 7, 10, 12, 9, 19, 22, 14, 15, 16, 13, 18, 21, 40, 43, 20, 27, 46, 17, 26, 33, 24, 35, 38, 32, 23, 29, 30, 31, 28, 25, 34, 36, 39, 37, 64, 42, 41, 67, 47, 60, 49, 48, 52, 45, 55, 44, 58, 69, 51, 50, 62, 53, 77, 54, 56, 83, 57, 66, 74, 65, 61, 102, 70, 71, 79, 78, 59, 68, 63, 72, 95, 86, 81, 76, 73, 75, 82, 106
Offset: 0

Views

Author

M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019

Keywords

Comments

That is, there are exactly three primes (counted with multiplicity) among the 6 pairwise sums of any four consecutive terms.
It remains unknown whether this is a permutation of the nonnegative numbers. There is some hope that this could be the case, and it seems coherent to choose offset 0 not only in view of this. The restriction to positive indices would then be a permutation of the positive integers, but not the smallest one with the given property.
Concerning the existence of the sequence: If the sequence is to be computed in a greedy manner, this means that for given n, we assume given P(n) := {a(n-1), a(n-2), a(n-3)} and thus S(n) := #{ primes x + y with x, y in P(n), x < y} which may equal 0, 1, 2 or 3. We have to find a(n) such that we have exactly 3 - S(n) primes in a(n) + P(n). It is easy to prove that this is always possible when 3 - S(n) is 0 or 1, and similar to the case of A329452 and A329453 when S(n) = 1. When S(n) = 0, however, we must find three primes in the same configuration as the elements of P(n). It is almost surprising that this can always be found up to n = 10^6. However, the sequence does not need to be computable in a greedy manner. That is, if for given P(n) no a(n) would exist such that a(n) + P(n) contains 3 - S(n) primes, this simply means that the considered value of a(n-1) was incorrect, and the next larger choice has to be made. Given this freedom, well-definedness of this sequence up to infinity is far more probable than, for example, the k-tuple conjecture.
Computational results are as follows:
a(10^5) = 99954 and all numbers below 99915 have appeared at that point.
a(10^6) = 1000053 and all numbers below 999845 have appeared at that point.

Examples

			We start with a(0) = 0, a(1) = 1, a(2) = 2, the smallest possibilities which do not lead to a contradiction.
Now there are already 2 primes, 0 + 2 and 1 + 2, among the pairwise sums, so the next term must generate exactly one further prime. It appears that a(3) = 4 is the smallest possible choice.
Then there are again two primes among the pairwise sums using {1, 2, 4}, and the next term must again produce one additional prime as sum with these. We find that a(4) = 5 is the smallest possibility.
		

Crossrefs

Cf. A329452 (2 primes among a(n+i)+a(n+j), 0 <= i < j < 4), A329453 (2 primes among a(n+i)+a(n+j), 0 <= i < j < 5).
Cf. A329333 (1 odd prime among a(n+i)+a(n+j), 0 <= i < j < 3), A329450 (no primes among a(n+i)+a(n+j), 0 <= i < j < 3).
Cf. A329405 ff: variants defined for positive integers.

Programs

A329416 Among the pairwise sums of any ten consecutive terms there are exactly two prime sums: lexicographically earliest such sequence of distinct positive numbers.

Original entry on oeis.org

1, 2, 3, 7, 13, 19, 23, 25, 31, 32, 17, 8, 26, 37, 43, 49, 14, 38, 55, 61, 11, 20, 35, 67, 73, 79, 57, 9, 5, 15, 21, 42, 27, 12, 33, 30, 39, 45, 47, 18, 48, 6, 51, 24, 63, 69, 72, 75, 16, 36, 54, 60, 22, 66, 10, 4, 40, 29, 28, 34, 44, 41, 46, 50, 52, 58, 64, 53, 70, 71, 59, 62, 76, 56, 82, 88, 94, 65, 100
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 14 2019

Keywords

Comments

Conjectured to be a permutation of the positive integers: a(10^6) = 10^6 + 2 and all numbers up to 10^6 - 7 have appeared at that point. - M. F. Hasler, Nov 15 2019

Examples

			a(1) = 1 is the smallest possible choice, there's no restriction on the first term.
a(2) = 2 as 2 is the smallest available integer not leading to a contradiction. Note that as 1 + 2 = 3 we already have one prime sum (on the required two) with the 10-set {1,2,a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10)}.
a(3) = 3 as 3 is the smallest available integer not leading to a contradiction. Note that as 2 + 3 = 5 we now have the two prime sums required with the 10-set {1,2,a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10)}.
a(4) = 7 as a(4) = 4, 5 or 6 would lead to a contradiction: indeed, the 10-sets {1,2,3,4,a(5),a(6),a(7),a(8),a(9),a(10)}, {1,2,3,5,a(5),a(6),a(7),a(8),a(9),a(10)} and {1,2,3,6,a(5),a(6),a(7),a(8),a(9),a(10)} will produce more than the two required prime sums. With a(4) = 7 we have no contradiction as the 10-set {1,2,3,7,a(5),a(6),a(7),a(8),a(9),a(10)} has now two prime sums so far: 1 + 2 = 3 and 2 + 3 = 5.
a(5) = 13 as a(5) = 4, 5, 6, 8, 9, 10, 11 or 12 would again lead to a contradiction (more than 2 prime sums with the 10-set); in combination with any other term before it, a(5) = 13 will produce only composite sums.
a(6) = 19 as 19 is the smallest available integer not leading to a contradiction: indeed, the 10-set {1,2,3,7,13,19,a(7),a(8),a(9),a(10)} shows two prime sums so far: 1 + 2 = 3 and 2 + 3 = 5.
a(7) = 23 as 23 is the smallest available integer not leading to a contradiction; indeed, the 10-set {1,2,3,7,13,19,23,a(8),a(9),a(10)} shows only two prime sums so far, which are 1 + 2 = 3 and 2 + 3 = 5.
a(8) = 25 as 25 is the smallest available integer not leading to a contradiction and producing two prime sums so far with the 10-set {1,2,3,7,13,19,23,25,a(9),a(10)}; etc.
		

Crossrefs

Cf. A329333 (3 consecutive terms, exactly 1 prime sum).
Cf. A329405 (no prime among the pairwise sums of 3 consecutive terms).
Cf. A329406 .. A329410 (exactly 1 prime sum using 4, ..., 10 consecutive terms).
Cf. A329411 .. A329415 (exactly 2 prime sums using 3, ..., 7 consecutive terms).
See also "nonnegative" variants: A329450 (0 primes using 3 terms), A329452 (2 primes using 4 terms), A329453 (2 primes using 5 terms), A329454 (3 primes using 4 terms), A329449 (4 primes using 4 terms), A329455 (3 primes using 5 terms), A329456 (4 primes using 5 terms).

Programs

  • PARI
    A329416(n, show=0, o=1, N=2, M=9, p=[], U, u=o)={for(n=o, n-1, show&&print1(o", "); U+=1<<(o-u); U>>=-u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2, #p, sum(j=1, i-1, isprime(p[i]+p[j])))); if(#pM. F. Hasler, Nov 15 2019

A329455 There are exactly three primes in {a(n+i) + a(n+j), 0 <= i < j <= 4} for any n >= 0: lexicographically earliest such sequence of distinct nonnegative integers.

Original entry on oeis.org

0, 1, 2, 4, 8, 6, 3, 10, 14, 11, 5, 9, 15, 26, 12, 17, 13, 7, 18, 16, 20, 21, 19, 23, 27, 40, 22, 31, 24, 25, 29, 28, 30, 32, 33, 39, 34, 36, 35, 38, 41, 46, 37, 43, 48, 42, 55, 47, 44, 45, 52, 49, 50, 53, 56, 58, 54, 57, 51, 73, 76, 61, 59, 63, 64, 68, 60, 69, 67, 62, 65, 66, 70, 71, 72, 79, 77, 74, 81, 86, 78, 89, 82, 85, 80, 99, 84, 83, 75, 92, 87, 88, 90, 91, 93, 94, 100
Offset: 0

Views

Author

M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019

Keywords

Comments

That is, there are exactly three primes among the 10 pairwise sums of any five consecutive terms.
It is unknown whether this is a permutation of the nonnegative numbers. There is hope that this could be the case, and it seems coherent to choose offset 0 not only in view of this. The restriction to positive indices would then be a permutation of the positive integers, but not the smallest one with the given property.
Concerning the existence of the sequence: If the sequence is to be computed in a greedy manner, this means that for given n, we assume given P(n) := {a(n-1), a(n-2), a(n-3), a(n-4)} and thus S(n) := #{ primes x + y with x, y in P(n), x < y} which may equal 0, 1, 2 or 3. We have to find a(n) such that we have exactly 3 - S(n) primes in a(n) + P(n). It is easy to prove that this is always possible when 3 - S(n) = 0 or 1, and for S(n) = 0 or 1, this is similar to the case of A329452 or A329453. However, the sequence does not need to be computable in a greedy manner. That is, if for given P(n) no a(n) would exist such that a(n) + P(n) contains 3 - S(n) primes, this simply means that the considered value of a(n-1) was incorrect, and the next larger choice has to be made. Given this freedom, well-definedness of this sequence up to infinity is far more probable than, for example, the k-tuple conjecture.
Computational results are as follows:
a(10^5) = 99954 and all numbers below 99915 have appeared at that point.
a(10^6) = 1000053 and all numbers below 999845 have appeared at that point.

Examples

			We start with a(0) = 0, a(1) = 1, a(2) = 2, the smallest possibilities which do not lead to a contradiction.
Now there are already 2 primes, 0 + 2 and 1 + 2, among the pairwise sums, so the next term must generate exactly one further prime. It appears that a(3) = 4 is the smallest possible choice.
Then there are 3 primes among the pairwise sums using {0, 1, 2, 4}, and the next term must not produce an additional prime as sum with these. The terms 0 and 1 exclude primes and (primes - 1). We find that a(4) = 8 is the smallest possibility.
Then there are 2 primes (1+2 and 1+4) among the pairwise sums using {1, 2, 4, 8}, and the next term must produce exactly one additional prime as sum with these terms. We find that a(5) = 6 is the smallest possibility (since 5+2 and 5+8 would give 2 primes).
		

Crossrefs

Cf. A329454 (3 primes among a(n+i)+a(n+j), 0 <= i < j <= 3).
Cf. A329452 (2 primes among a(n+i)+a(n+j), 0 <= i < j <= 3), A329453 (2 primes among a(n+i)+a(n+j), 0 <= i < j <= 4).
Cf. A329333 (1 odd prime among a(n+i)+a(n+j), 0 <= i < j <= 2), A329450 (0 primes among a(n+i)+a(n+j), 0 <= i < j <= 2).
Cf. A329405 ff: variants defined for positive integers.

Programs

  • PARI
    A329455(n, show=0, o=0, N=3, M=4, p=[], U, u=o)={for(n=o, n-1, show>0&& print1(o", "); U+=1<<(o-u); U>>=-u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2, #p, sum(j=1, i-1, isprime(p[i]+p[j])))); if(#p
    				

A329456 For any n >= 0, exactly four sums a(n+i) + a(n+j) are prime, for 0 <= i < j <= 4: lexicographically earliest such sequence of distinct nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 24, 4, 5, 7, 8, 6, 9, 10, 11, 13, 18, 12, 16, 19, 29, 25, 42, 14, 15, 17, 20, 21, 22, 23, 26, 38, 45, 27, 28, 33, 40, 32, 31, 39, 30, 41, 48, 49, 36, 35, 34, 37, 43, 66, 47, 50, 46, 51, 52, 53, 55, 54, 44, 56, 83, 63, 59, 68, 64, 67, 72, 85, 57, 70, 79, 78, 58, 60, 61, 121, 76, 71, 90, 73
Offset: 0

Views

Author

M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019

Keywords

Comments

That is, there are exactly four primes (counted with multiplicity) among the 10 pairwise sums of any five consecutive terms. (It is possible to have 4 primes among the pairwise sums of any 4 consecutive elements, see A329449.)
This map is defined with offset 0 so as to have a permutation of the nonnegative integers in case each of these eventually appears, which is not yet proved (cf. below). The restriction to positive indices would then be a permutation of the positive integers with the same property, but not the lexicographically earliest such, which starts (1, 2, 3, 4, 23, 8, 5, 6, 10, 7, 9, 11, 12, ...).
Concerning the existence of the sequence with infinite length: If the sequence is to be computed in a greedy manner, this means that for given P(n) := {a(n-1), a(n-2), a(n-3), a(n-4)} and thus N(n) := #{ primes x + y with x, y in P(n), x < y} in {0, ..., 4}, we have to find a(n) such that we have exactly 4 - N(n) primes in a(n) + N(n). It is easy to prove that this is always possible when 4 - N(n) = 0 or 1. Otherwise, similar to A329452, ..., A329455, we see that P(n) is an "admissible constellation" in the sense that a(n-5) + P(n) already gave the number of primes required now. So a (weaker) variant of the k-tuple conjecture ensures we can find this a(n). But the sequence need not be computable in greedy manner! That is, if ever for given P(n) no convenient a(n) would exist, this just means that the considered value of a(n-1) (and possibly a(n-2)) was incorrect, and the next larger choice has to be made. Given this freedom, there is no doubt that this sequence is well defined up to infinity.
Concerning surjectivity: If a number m would never appear, this means that m + P(n) will never have the required number of 4 - N(n) primes for all n with a(n) > m, in spite of having found for each of these n at least two other solutions, a(n-4) + P(n) and a(n) + P(n) which both gave 4 - N(n) primes. This appears extremely unlikely and thus as strong evidence in favor of surjectivity.
See examples for further computational evidence.

Examples

			We start with a(0) = 0, a(1) = 1, a(2) = 2, a(3) = 3, the smallest possibilities which do not lead to a contradiction. Indeed, the four sums 0 + 2, 0 + 3, 1 + 2 and 2 + 3 are prime.
Now the next term must not give an additional prime when added to any of {0, 1, 2, 3}. We find that a(4) = 24 is the smallest possible choice.
Then there are 2 primes (1+2, 2+3) among the pairwise sums using {1, 2, 3, 24}, so the next term must produce two more prime sums. We find that a(5) = 4 is correct, with 1+4 and 3+4.
a(10^5) = 99948.
a(10^6) = 999923 and all numbers below 999904 occurred by then.
		

Crossrefs

Other sequences with N primes among pairwise sums of M consecutive terms, starting with a(o) = o, sorted by decreasing N: A329581 (N=11, M=8, o=0), A329580 (N=10, M=8, o=0), A329579 (N=9, M=7, o=0), A329577 (N=7, M=7, o=0), A329566 (N=6, M=6, o=0), A329449 (N=4, M=4, o=0), this A329456 (N=4, M=5, o=0), A329454 (3, 4, 0), A329455 (3, 5, 0), A329411 (2, 3, o=1 and 0), A329452 (2, 4, 0), A329412 (2, 4, 1), A329453 (2, 5, 0), A329413 (2, 5, 1), A329333 (N=1, M=3, o=0 and 1), A329450 (0, 3, 0), A329405 (0, 3, 1).

Programs

  • PARI
    A329455(n, show=0, o=0, N=4, M=4, p=[], U, u=o)={for(n=o, n-1, show>0&& print1(o", "); U+=1<<(o-u); U>>=-u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=N-sum(i=2, #p, sum(j=1, i-1, isprime(p[i]+p[j])))); if(#p
    				

A329581 For every n >= 0, exactly 11 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 8: lexicographically earliest such sequence of distinct nonnegative numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 20, 9, 8, 11, 23, 7, 10, 21, 50, 30, 36, 17, 31, 37, 16, 12, 14, 25, 42, 22, 67, 15, 19, 28, 13, 34, 18, 40, 24, 41, 139, 27, 49, 43, 60, 124, 52, 26, 57, 75, 87, 32, 48, 35, 44, 92, 39, 29, 38, 45, 33, 59, 98, 64, 51, 46, 218, 53, 93, 58, 56, 47, 135, 54, 134, 55, 95, 72, 62, 65, 85
Offset: 0

Views

Author

M. F. Hasler, Nov 17 2019

Keywords

Comments

That is, there are 11 primes, counted with multiplicity, among the 28 pairwise sums of any 8 consecutive terms.
Is this a permutation of the nonnegative integers?
If so, then the restriction to [1..oo) is a permutation of the positive integers, but not the lexicographically earliest one with this property, which starts (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 24, 23, 30, 29, 14, ...).

Examples

			In P(7) := {0, 1, 2, 3, 4, 5, 6} there are already S(7) := 10 primes 0+2, 0+3, 0+5, 1+2, 1+4, 1+6, 2+3, 2+5, 3+4, 5+6 among the pairwise sums, so the next term a(7) must produce exactly one more prime when added to elements of P(7). We find that a(7) = 20 is the smallest possible term (with 20 + 3 = 23).
Then in P(8) = {1, 2, 3, 4, 5, 6, 20} there are S(8) = 8 primes among the pairwise sums, so a(8) must produce exactly 3 more primes when added to elements of P(8). We find a(8) = 9 is the smallest possibility (with 2+9, 4+9 and 20+9).
And so on.
		

Crossrefs

Cf. A329580 (10 primes using 8 consecutive terms), A329579 (9 primes using 7 consecutive terms), A329425 (6 primes using 5 consecutive terms).
Cf. A329455 (4 primes using 5 consecutive terms), A329455 (3 primes using 5 consecutive terms), A329453 (2 primes using 5 consecutive terms), A329452 (2 primes using 4 consecutive terms).
Cf. A329577 (7 primes using 7 consecutive terms), A329566 (6 primes using 6 consecutive terms), A329449 (4 primes using 4 consecutive terms).
Cf. A329454 (3 primes using 4 consecutive terms), A329411 (2 primes using 3 consecutive terms), A329333 (1 odd prime using 3 terms), A329450 (0 primes using 3 terms).
Cf. A329405 ff: other variants defined for positive integers.

Programs

  • PARI
    A329581(n,show=0,o=0,N=11,M=7,p=[],U,u=o)={for(n=o,n-1, if(show>0,print1(o", "), show<0,listput(L,o)); U+=1<<(o-u); U>>=-u+u+=valuation(U+1,2); p=concat(if(#p>=M,p[^1],p),o); my(c=N-sum(i=2,#p, sum(j=1,i-1, isprime(p[i]+p[j]))));if(#p
    				
Showing 1-10 of 28 results. Next