Search: a329449 -id:a329449
|
|
A055265
|
|
a(n) is the smallest positive integer not already in the sequence such that a(n)+a(n-1) is prime, starting with a(1)=1.
|
|
+10
40
|
|
|
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, 34, 27, 26, 33, 38, 35, 32, 39, 40, 43, 36, 37, 42, 41, 48, 49, 52, 45, 44, 53, 50, 47, 54, 55, 46, 51, 56, 57, 70, 61, 66, 65, 62, 69, 58, 73, 64, 63, 68, 59, 72, 67, 60
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The sequence is well-defined (the terms must alternate in parity, and by Dirichlet's theorem a(n+1) always exists). - N. J. A. Sloane, Mar 07 2017
Does every positive integer eventually occur? - Dmitry Kamenetsky, May 27 2009. Reply from Robert G. Wilson v, May 27 2009: The answer is almost certainly yes, on probabilistic grounds.
It appears that this is the limit of the rows of A051237. That those rows do approach a limit seems certain, and given that that limit exists, that this sequence is the limit seems even more likely, but no proof is known for either conjecture. - Robert G. Wilson v, Mar 11 2011, edited by Franklin T. Adams-Watters, Mar 17 2011
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 A055266 & A253074 (M = 2, N = 0), A329333, A329405 - A329416, A329449 - A329456, A329563 - A329581, and the OEIS Wiki page. - M. F. Hasler, Feb 11 2020
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(5) = 7 because 1, 2, 3 and 4 have already been used and neither 4 + 5 = 9 nor 4 + 6 = 10 are prime while 4 + 7 = 11 is prime.
|
|
MAPLE
|
local a, i, known ;
option remember;
if n =1 then
1;
else
for a from 1 do
known := false;
for i from 1 to n-1 do
if procname(i) = a then
known := true;
break;
end if;
end do:
if not known and isprime(procname(n-1)+a) then
return a;
end if;
end do:
end if;
end proc:
|
|
MATHEMATICA
|
f[s_List] := Block[{k = 1, a = s[[ -1]]}, While[ MemberQ[s, k] || ! PrimeQ[a + k], k++ ]; Append[s, k]]; Nest[f, {1}, 71] (* Robert G. Wilson v, May 27 2009 *)
q=2000; a={1}; z=Range[2, 2*q]; While[Length[z]>q-1, k=1; While[!PrimeQ[z[[k]]+Last[a]], k++]; AppendTo[a, z[[k]]]; z=Delete[z, k]]; Print[a] (*200 times faster*) (* Vladimir Joseph Stephan Orlovsky, May 03 2011 *)
|
|
PROG
|
(HP 50G Calculator) << DUPDUP + 2 -> N M L << { 1 } 1 N 1 - FOR i L M FOR j DUP j POS NOT IF THEN j DUP 'L' STO M 'j' STO END NEXT OVER i GET SWAP WHILE DUP2 + DUP ISPRIME? NOT REPEAT DROP DO 1 + 3 PICK OVER POS NOT UNTIL END END ROT DROP2 + NEXT >> >> Gerald Hillier, Oct 28 2008
(Haskell)
import Data.List (delete)
a055265 n = a055265_list !! (n-1)
a055265_list = 1 : f 1 [2..] where
f x vs = g vs where
g (w:ws) = if a010051 (x + w) == 1
then w : f w (delete w vs) else g ws
(PARI) v=[1]; n=1; while(n<50, if(isprime(v[#v]+n)&&!vecsearch(vecsort(v), n), v=concat(v, n); n=0); n++); v \\ Derek Orr, Jun 01 2015
(PARI) U=-a=1; vector(100, k, k=valuation(1+U+=1<<a, 2); while(bittest(U, k)|| !isprime(a+k), k++); a=k) \\ M. F. Hasler, Feb 11 2020
|
|
CROSSREFS
|
Cf. A086527 (the primes a(n)+a(n-1)).
Cf. A070942 (n's such that a(1..n) is a permutation of (1..n)). - Zak Seidov, Oct 19 2011
See A282695 for deviation from identity sequence.
A073659 is a version where the partial sums must be primes.
|
|
KEYWORD
|
easy,nice,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A128280
|
|
a(n) is the least number not occurring earlier such that a(n)+a(n-1) is prime, a(0) = 0.
|
|
+10
19
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
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
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(PARI) {a=0; u=0; for(n=1, 99, u+=1<<a; print1(a", "); for(k=1, 9e9, bittest(u, k)&&next; isprime(a+k)&&(a=k)&&next(2)))}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A329425
|
|
For all n >= 0, six among (a(n+i) + a(n+j), 0 <= i < j < 5) are prime: lexicographically first such sequence of distinct nonnegative integers.
|
|
+10
18
|
|
|
0, 1, 2, 3, 4, 9, 8, 10, 33, 14, 93, 20, 17, 23, 44, 6, 24, 35, 65, 5, 18, 32, 11, 12, 29, 30, 7, 31, 72, 16, 22, 25, 37, 15, 46, 64, 43, 28, 85, 19, 54, 13, 88, 34, 49, 39, 40, 27, 100, 57, 26, 52, 111, 21, 38, 45, 62, 41, 51, 56, 47, 116, 50, 81, 63, 68, 59, 170, 69, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
The restriction to [1, oo) is the lexicographically first such sequence of positive integers. (This is rather exceptional, cf. A128280 vs A055265, A329405 vs A329450, ..., see the wiki page for more.)
Conjectured to be a permutation, i.e., all n >= 0 appear. The restriction to [1, oo) is then the lexicographically first such permutation of the positive integers.
Among pairwise sums of 5 consecutive terms, there cannot be more than 2 x 3 = 6 primes: see the wiki page for this and further considerations and variants.
|
|
LINKS
|
|
|
MAPLE
|
R:= 0, 1, 2, 3, 4:
S:= {R}:
for i from 1 to 100 do
for x from 5 do
if member(x, S) then next fi;
n1:= nops(select(isprime, [seq(seq(R[i+j]+R[i+k], j=1..k-1), k=1..4)]));
if nops(select(isprime, [seq(R[i+j]+x, j=1..4)]))+n1 = 6 then
R:= R, x; S:= S union {x}; break
fi
od od:
|
|
PROG
|
(PARI) A329425_upto(N) = S(N, 6, 5, 0) \\ see the wiki page for the function S().
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A329411
|
|
Among the pairwise sums of any three consecutive terms there are exactly two prime sums: lexicographically earliest such sequence of distinct positive numbers.
|
|
+10
17
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
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
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(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
|
|
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. A055266 (no prime sum among 2 consecutive terms), A329405 (no prime among the pairwise sums of 3 consecutive terms).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A329416
|
|
Among the pairwise sums of any ten consecutive terms there are exactly two prime sums: lexicographically earliest such sequence of distinct positive numbers.
|
|
+10
14
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
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
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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(#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||[o=k, break])); print([u]); o} \\ Optional args: show=1: print terms a(o..n-1); o=0: start with a(0)=0; N, M: produce N primes using M+1 consecutive terms. - M. F. Hasler, Nov 15 2019
|
|
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).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
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.
|
|
+10
13
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
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.
|
|
LINKS
|
|
|
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 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.
|
|
PROG
|
(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<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 || [o=k, break])); show&&print([u]); o} \\ Optional args: show=1: print a(o..n-1), show=-1: print only [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: 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).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
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.
|
|
+10
13
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
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, ...).
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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<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||[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; o=1: start at a(1)=1; N, M: find N primes using M+1 terms
|
|
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.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
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.
|
|
+10
10
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
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, ...).
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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<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||[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; o=1: start at a(1)=1; N, M: find N primes using M+1 terms. See the wiki page for a function S() which returns a vector: a(0..n-1) = S(n, 6, 6).
|
|
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).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
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.
|
|
+10
6
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
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.
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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<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|| [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; 1).
|
|
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).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
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.
|
|
+10
5
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
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, ...).
|
|
LINKS
|
|
|
PROG
|
(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<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||[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; o=1: start at a(1)=1; N, M: find N primes using M+1 terms
|
|
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.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.024 seconds
|