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 17 results. Next

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.

A128280 a(n) is the least number not occurring earlier such that a(n)+a(n-1) is prime, a(0) = 0.

Original entry on oeis.org

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

Views

Author

Zak Seidov, May 03 2007

Keywords

Comments

Original definition: start with a(1) = 2. See A055265 for start with a(1) = 1.
The sequence may well be a rearrangement of natural numbers. Interestingly, subsets of first n terms are permutations of 1..n for n = {2, 4, 8, 10, 18, 22, 24, 56, ...}. E.g., first 56 terms: {2, 1, 4, 3, 8, 5, 6, 7, 10, 9, 14, 15, 16, 13, 18, 11, 12, 17, 20, 21, 22, 19, 24, 23, 30, 29, 32, 27, 26, 33, 28, 25, 34, 37, 36, 31, 40, 39, 44, 35, 38, 41, 42, 47, 50, 51, 46, 43, 54, 49, 48, 53, 56, 45, 52, 55} are a permutation of 1..56.
Without altering the definition nor the existing values, one can as well start with a(0) = 0 and get (conjecturally) a permutation of the nonnegative integers. This sequence is in some sense the "arithmetic" analog of the "digital" variant A231433: Here we add subsequent terms, there the digits are concatenated. - M. F. Hasler, Nov 09 2013
The sequence is also a particular case of "among the pairwise sums of any M consecutive terms, N are prime", with M = 2, N = 1. For other M, N see A329333, A329405 ff, A329449 ff and the OEIS Wiki page. - M. F. Hasler, Nov 24 2019

Crossrefs

Cf. A083236.
Cf. A055265 for the variant starting with a(1) = 1, and A329333, A329405, ..., A329425 and A329449, ..., A329581 for other variants. - M. F. Hasler, Nov 24 2019

Programs

  • PARI
    {a=0;u=0; for(n=1, 99, u+=1<
    				

Formula

a(2n-1) = A055265(2n-1) + 1, a(2n) = A055265(2n) - 1, for all n >= 1. - M. F. Hasler, Feb 11 2020

Extensions

Initial a(0) = 0 prefixed by M. F. Hasler, Nov 09 2013

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
    				

A329566 For all n >= 0, exactly six sums are prime among a(n+i) + a(n+j), 0 <= i < j < 6; lexicographically earliest such sequence of distinct nonnegative numbers.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 17 2019

Keywords

Comments

That is, there are 6 primes, counted with multiplicity, among the 15 pairwise sums of any 6 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, 7, 6, 8, 9, 10, 11, 13, 18, 19, 16, 12, 24, ...).

Examples

			For n = 0, we consider pairwise sums of the first 6 terms a(0..5) = (0, 1, 2, 3, 4, 24): We have (a(i) + a(j), 0 <= i < j < 6) = (1; 2, 3; 3, 4, 5; 4, 5, 6, 7; 24, 25, 26, 27, 28) among which there are 6 primes, counted with repetition. This justifies taking a(0..4) = (0, ..., 4), the smallest possible choices for these first 5 terms. Since no smaller a(5) between 5 and 23 has this property, this is the start of the lexicographically earliest nonnegative sequence with this property and no duplicate terms.
Then we find that a(6) = 5 is possible, also giving 6 prime sums for n = 1, so this is the correct continuation (modulo later confirmation that the sequence can be continued without contradiction given this choice).
Next we find that a(7) = 6 is not possible, it would give only 5 prime sums using the 6 consecutive terms (2, 3, 4, 24, 5, 6). However, a(7) = 7 is a valid continuation, and so on.
		

Crossrefs

Cf. A329425 (6 primes using 5 consecutive terms).
Cf. A329449 (4 primes using 4 consecutive terms), A329456 (4 primes using 5 consecutive terms).
Cf. A329454 (3 primes using 4 consecutive terms), A329455 (3 primes using 5 consecutive terms).
Cf. A329411 (2 primes using 3 consecutive terms), A329452 (2 primes using 4 consecutive terms), A329453 (2 primes using 5 consecutive terms).
Cf. A329333 (1 (odd) prime using 3 terms), A128280 & A055265 (1 prime using 2 terms); A055266 & A253074 (0 primes using 2 terms), A329405 & A329450 (0 primes using 3 terms), A329406 ff: other variants.

Programs

  • PARI
    A329566(n,show=0,o=0,N=6,M=5,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
    				

A329563 For all n >= 1, exactly five sums are prime among a(n+i) + a(n+j), 0 <= i < j < 5; lexicographically earliest such sequence of distinct positive numbers.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Feb 09 2020

Keywords

Comments

That is, there are 5 primes, counted with multiplicity, among the 10 pairwise sums of any 5 consecutive terms.
Conjectured to be a permutation of the positive integers.
This sequence is quite different from the restriction of the "nonnegative" variant A329564 to positive indices: it seems that the two have no common terms beyond a(6) = 8, except for the accidental a(22) = 15 and maybe some later coincidences of this type. There also appears to be no other simple relation between the terms of these sequences, in contrast to, e.g., A055265 vs. A128280.

Examples

			For n = 1, we consider pairwise sums among the first 5 terms chosen as small as possible, a(1..5) = (1, 2, 3, 4, 5). We see that we have indeed 5 primes among the sums 1+2, 1+3, 1+4, 1+5, 2+3, 2+4, 2+5, 3+4, 3+5, 4+5.
Then, to get a(6), consider first the pairwise sums among terms a(2..5), (2+3, 2+4, 2+5; 3+4, 3+5; 4+5), among which there are 3 primes, counted with multiplicity (i.e., the prime 7 is there two times). So the new term a(6) must give exactly two more prime sums with the terms a(2..5). We find that 6 or 7 would give just one more (5+6 resp. 4+7), but a(6) = 8 gives exactly two more, 3+8 and 5+8.
		

Crossrefs

Cf. A329425 (6 primes using 5 consecutive terms), A329566 (6 primes using 6 consecutive terms).
Cf. A329449 (4 primes using 4 consecutive terms), A329456 (4 primes using 5 consecutive terms).
Cf. A329454 (3 primes using 4 consecutive terms), A329455 (3 primes using 5 consecutive terms).
Cf. A329411 (2 primes using 3 consecutive terms), A329452 (2 primes using 4 consecutive terms), A329453 (2 primes using 5 consecutive terms).
Cf. A329333 (1 (odd) prime using 3 terms), A128280 & A055265 (1 prime using 2 terms); A055266 & A253074 (0 primes using 2 terms), A329405 & A329450 (0 primes using 3 terms), A329406 ff: other variants.

Programs

  • PARI
    {A329563(n,show=1,o=1,N=5,M=4,p=[],u=o,U)=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])))); if(#p
    				

A329577 For every n >= 0, exactly seven sums are prime among a(n+i) + a(n+j), 0 <= i < j < 7; lexicographically earliest such sequence of distinct nonnegative numbers.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 17 2019

Keywords

Comments

That is, there are 7 primes, counted with multiplicity, among the 21 pairwise sums of any 7 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, 89, 8, 7, 9, 10, 11, 14, 12, 17, 19, 18, 13, ...).

Crossrefs

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

Programs

  • PARI
    A329577(n,show=0,o=0,N=7,M=6,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
    				

A329568 For all n >= 1, exactly 9 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 6: lexicographically earliest such sequence of distinct positive numbers.

Original entry on oeis.org

1, 2, 3, 9, 4, 10, 27, 14, 33, 57, 26, 40, 87, 50, 21, 63, 16, 20, 51, 8, 81, 93, 46, 56, 15, 58, 135, 183, 28, 44, 39, 88, 69, 123, 34, 68, 105, 128, 45, 129, 22, 52, 141, 38, 75, 159, 32, 82, 99, 64, 117, 147, 80, 94, 177, 116, 237, 273, 74, 100, 387, 76, 207, 357, 62, 104, 165, 86, 77, 95
Offset: 1

Views

Author

M. F. Hasler, Feb 10 2020

Keywords

Comments

That is, there are nine primes, counted with multiplicity, among the 15 pairwise sums of any six consecutive terms. This is the maximum number of possible prime sums for any set of 6 numbers > 1, see wiki page for details.
Conjectured to be a permutation of the positive integers. See A329569 = (0, 1, 2, 5, 6, 11, 12, 17, ...) for the quite different variant for nonnegative integers.
For n > 6, a(n) is the smallest number not used earlier such that the set a(n) + {a(n-5), ..., a(n-1)} has the same number of primes as a(n-6) + {a(n-5), ..., a(n-1)}. Such a number always exists, by definition of the sequence. (If it would not exist for a given n, the term a(n-1) (or earlier) "was wrong and must be corrected", so to say.) See the wiki page for further considerations about existence and surjectivity.
For a(4), one must exclude the values {4, ..., 8} to get an infinite sequence, but for all other (at least several hundred) terms, the greedy choice gives the correct solution.

Crossrefs

Cf. A055265, A128280 (1 prime from 2 terms), A329333 (1 prime from 3 terms), A329405, ..., A329417 (N primes from M terms >= 1), A329425, A329449, ..., A329581 (N primes from M terms >= 0).

Programs

  • PARI
    {A329568(n,show=0,o=1,N=9,M=5,X=[[4,x]|x<-[4..8]],p=[],u=o,U)=for(n=o+1,n, 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|x<-p,isprime(x+k)],#p>=M)|| setsearch(X,[n,k])|| [o=k,break])); show&&print([u]);o} \\ optional args: show=1: print a(o..n-1), show=-1: append them on global list L, in both cases print [least unused number] at the end. Parameters N,M,o,... allow getting other variants, see the wiki page for more.

A329569 For all n >= 0, exactly 9 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 6: lexicographically earliest such sequence of distinct nonnegative numbers.

Original entry on oeis.org

0, 1, 2, 5, 6, 11, 12, 17, 26, 35, 36, 47, 24, 77, 32, 65, 62, 149, 74, 9, 8, 39, 14, 15, 4, 3, 28, 33, 38, 69, 10, 51, 20, 21, 58, 93, 16, 81, 46, 13, 70, 27, 76, 37, 34, 97, 52, 7, 30, 49, 40, 31, 22, 67, 82, 19, 42, 25, 64, 85, 18, 109, 54, 43, 88, 139, 84, 145, 94, 79, 112, 55, 48, 289, 144
Offset: 0

Views

Author

M. F. Hasler, Feb 10 2020

Keywords

Comments

That is, there are nine primes, counted with multiplicity, among the 15 pairwise sums of any six consecutive terms. This is the maximum: there can't be more than 9 primes among the pairwise sums of any 6 numbers > 1, cf. wiki page in LINKS.
Conjectured to be a permutation of the nonnegative integers. The restriction to [1,oo) is then a permutation of the positive integers with similar properties, but different from the lexico-smallest one, A329568 = (1, 2, 3, 9, 4, 10, 27, ...).
For n > 5, a(n) is the smallest number not used earlier such that the set a(n) + {a(n-5), ..., a(n-1)} has the same number of primes as a(n-6) + {a(n-5), ..., a(n-1)}. Such a number always exists, by definition of the sequence. (If it would not exist for a given n, the term a(n-1) (or earlier) "is wrong and must be corrected", so to say.) See the wiki page for further considerations about existence and surjectivity.
For a(3) and a(4), one must exclude values 3 & 4 to be able to continue the sequence indefinitely, but in all other cases (at least for several hundred terms), the greedy choice gives the correct solution.
The values 3, 4 and 7 appear quite late at indices 25, 24 resp. 47.

Crossrefs

Cf. A055265, A128280 (1 prime from 2 terms), A329333 (1 prime from 3 terms), A329405, ..., A329416 (N primes from M terms >= 1), A329425, A329449, ..., A329581 (N primes from M terms >= 0).

Programs

  • PARI
    {A329569(n,show=0,o=0,N=9,M=5,X=[[3,3],[3,4],[4,3],[4,4]],p=[],u=o,U)=for(n=o+1,n, 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|x<-p,isprime(x+k)],#p>=M)|| setsearch(X,[n,k])|| [o=k,break])); show&&print([u]);o} \\ optional args: show=1: print a(o..n-1), show=-1: append them on global list L, in both cases print [least unused number] at the end. Parameters N,M,o,... allow getting other variants, see the wiki page for more.

A329579 For every n >= 0, exactly nine sums are prime among a(n+i) + a(n+j), 0 <= i < j < 7; lexicographically earliest such sequence of distinct nonnegative numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 20, 9, 10, 8, 33, 11, 6, 50, 21, 17, 56, 12, 47, 14, 26, 7, 125, 15, 24, 83, 54, 66, 13, 35, 22, 18, 19, 48, 23, 31, 28, 30, 25, 16, 36, 42, 121, 29, 43, 37, 46, 70, 72, 60, 27, 79, 67, 40, 34, 39, 32, 69, 38, 41, 44, 45, 51, 58, 62, 86, 52, 53, 105, 171, 65, 74, 146, 68, 63, 123, 76
Offset: 0

Views

Author

M. F. Hasler, Nov 17 2019

Keywords

Comments

That is, there are 9 primes, counted with multiplicity, among the 21 pairwise sums of any 7 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 maybe not the lexicographically earliest one with this property.

Crossrefs

Cf. A329577 (7 primes using 7 consecutive terms), A329566 (6 primes using 6 consecutive terms), A329449 (4 primes using 4 consecutive terms).
Cf. A329425 (6 primes using 5 consecutive terms), 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. 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
    A329579(n,show=0,o=0,N=9,M=6,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
    				

A329580 For every n >= 0, exactly 10 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, 90, 7, 11, 8, 9, 10, 12, 13, 30, 29, 31, 14, 16, 15, 17, 22, 42, 19, 25, 18, 24, 20, 23, 28, 33, 43, 35, 36, 38, 26, 21, 32, 27, 34, 71, 37, 39, 40, 44, 63, 64, 68, 41, 46, 183, 50, 45, 333, 51, 98, 47, 58, 62, 69, 65, 48, 101, 66, 49, 61, 78, 57, 53, 180, 52, 55, 96, 631, 54, 56, 83, 75, 95, 74, 116, 60
Offset: 0

Views

Author

M. F. Hasler, Nov 17 2019

Keywords

Comments

That is, there are 10 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, 19, 10, 8, 9, 12, 11, 18, 13, 29, ...).
We remark the surprisingly large numbers 333 and 631 among the first terms.

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 not produce any more primes when added to elements of P(7). We find that a(7) = 90 is the smallest possible term.
Then in P(8) = {1, 2, 3, 4, 5, 6, 90} there are S(8) = 7 primes among the pairwise sums, so a(8) must produce 3 more primes when added to elements of P(8). We find a(8) = 7 is the smallest possibility (with 4+7, 6+7 and 90+7).
And so on.
		

Crossrefs

Cf. 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
    A329580(n,show=0,o=0,N=10,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 17 results. Next