[go: up one dir, main page]

login
Search: a329568 -id:a329568
     Sort: relevance | references | number | modified | created      Format: long | short | data
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.
+10
22
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,3
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.
LINKS
Eric Angelini, Prime sums from neighbouring terms, personal blog "Cinquante signes" (and post to the SeqFan list), Nov. 11, 2019.
M. F. Hasler, Prime sums from neighboring terms, OEIS Wiki, Nov. 23, 2019.
EXAMPLE
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.
PROG
(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.
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).
KEYWORD
nonn
AUTHOR
M. F. Hasler, based on an idea from Eric Angelini, Nov 15 2019
STATUS
approved
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.
+10
4
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,3
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.
LINKS
Éric Angelini, Prime sums from neighbouring terms, SeqFan list, Nov 11 2019.
M. F. Hasler, Prime sums from neighboring terms, OEIS Wiki, Nov 23 2019.
PROG
(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.
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).
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 10 2020
STATUS
approved
For all n >= 0, exactly five sums are prime among a(n+i) + a(n+j), 0 <= i < j < 5; lexicographically earliest such sequence of distinct nonnegative numbers.
+10
2
0, 1, 2, 3, 6, 5, 8, 11, 7, 12, 29, 18, 19, 4, 13, 9, 22, 10, 21, 14, 57, 16, 15, 17, 26, 27, 20, 23, 33, 34, 38, 45, 25, 28, 51, 46, 31, 43, 58, 30, 24, 37, 49, 35, 36, 102, 47, 42, 55, 32, 41, 48, 65, 39, 62, 44, 40, 63, 69, 50, 68, 59, 80, 71, 54, 77, 60, 53, 56, 74, 75
OFFSET
0,3
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 nonnegative integers.
If so, then the restriction to [1..oo) is a permutation of the positive integers, but not the smallest such, which is given in A329563. It seems that the two sequences 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. - M. F. Hasler, Feb 12 2020
LINKS
M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
EXAMPLE
For n = 0, we consider pairwise sums among the first 5 terms a(0..4), among which we must have 5 primes. To get a(4), consider first a(0..3) = (0, 1, 2, 3) and the pairwise sums (a(i) + a(j), 0 <= i < j <= 3) = (1; 2, 3; 3, 4, 5) among which there are 4 primes, counted with multiplicity (i.e., the prime 3 is there two times). So the additional term a(4) must give exactly one more prime sum with all of a(0..3). We find that 4 or 5 would give two more primes, but a(4) = 6 gives exactly one more, 1 + 6 = 7.
Now, for n = 1 we forget the initial 0 and consider the pairwise sums of the remaining terms {1, 2, 3, 6}. There are 3 prime sums, so the next term must give two more. The term 4 would give two more (1+4 and 3+4) primes, but thereafter we would have {2, 3, 6, 4} with only 2 prime sums and impossibility to add one term to get three more prime sums: 2+x, 6+x and 4+x can't be all prime for x > 1.
Therefore 4 isn't the next term, and we try a(5) = 5 which indeed gives the required number of primes, and also allows us to continue.
PROG
(PARI) {A329564(n, show=1, o=0, N=5, M=4, X=[[4, 4]], p=[], u, 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<M&&sum(i=1, #p, isprime(p[i]+u))<=c, o=u)|| for(k=u, oo, bittest(U, k-u)|| sum(i=1, #p, isprime(p[i]+k))!=c|| 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. See the wiki page for a function S() which returns a vector: a(0..n-1) = S(5, 5; 0).
CROSSREFS
Cf. A329425 (6 primes using 5 consecutive terms).
Cf. A055266 & A253074 (0 primes using 2 terms), A329405 & A329450 (0 primes using 3 terms), A055265 & A128280 (1 prime using 2 terms), A329333, A329406 - A329410 (1 prime using 3, ..., 10 terms), A329411 - A329416 and A329452, A329453 (2 primes using 3, ..., 10 terms), A329454 & A329455 (3 primes using 4 resp. 5 terms), A329449 & A329456 (4 primes using 4 resp. 5 terms), A329568 & A329569 (9 primes using 6 terms), A329572 & A329573 (12 primes using 7 terms), A329563 - A329581: other variants.
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 09 2020
STATUS
approved

Search completed in 0.010 seconds