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
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.
- Jean-Marc Falcoz, Table of n, a(n) for n = 0..20000.
- Eric Angelini, Prime sums from neighbouring terms, personal blog "Cinquante signes" (and post to the SeqFan list), Nov. 11, 2019.
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of html file, with permission]
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of pdf file, with permission]
- M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
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.
-
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 *)
-
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, ...)
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
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.
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).
-
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 *)
-
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).
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
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.
- Eric Angelini, Prime sums from neighbouring terms, personal blog "Cinquante signes" (and post to the SeqFan list), Nov. 11, 2019.
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of html file, with permission]
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of pdf file, with permission]
- M. F. Hasler, Prime sums from neighboring terms, OEIS Wiki, Nov. 23, 2019.
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).
-
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
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.
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).
-
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
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.
- Jean-Marc Falcoz, Table of n, a(n) for n = 1..10000
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of html file, with permission]
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of pdf file, with permission]
- M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
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.
A055266 (no prime sum among 2 consecutive terms),
A329405 (no prime among the pairwise sums of 3 consecutive terms).
-
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 *)
-
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
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.
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.
-
Nest[Block[{k = 3}, While[Nand[FreeQ[#, k], Count[Subsets[Append[Take[#, -3], k], {2}], ?(PrimeQ@ Total@ # &)] == 3], k++]; Append[#, k]] &, {0, 1, 2}, 84] (* _Michael De Vlieger, Nov 15 2019 *)
-
A329454(n, show=0, o=0, N=3, M=3, 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(#p
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
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.
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).
-
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
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).
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.
-
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
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.
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).
-
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
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.
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.
-
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.
Comments