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

A328997 Primes arising as sums of pairs of terms in A329333, in order of appearance.

Original entry on oeis.org

2, 3, 5, 13, 7, 11, 13, 13, 19, 19, 23, 23, 29, 29, 31, 31, 37, 37, 41, 41, 37, 47, 41, 47, 47, 53, 53, 59, 59, 61, 61, 67, 67, 73, 67, 73, 73, 79, 79, 83, 83, 89, 89, 79, 79, 89, 97, 101, 101, 97, 97, 101, 109, 107, 107, 109, 113, 113, 127, 127, 131
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2019

Keywords

Examples

			A329333 begins 0, 1, 2, 7, 3, 6, 4, 5, 8, 10, 11, 9, 12, 14, 15, 13, 18, 17, 19, 20, ...
so we see the primes 2, 3, 5, 13, 7, 11, 13, 13, ...
		

Crossrefs

A328998 Primes that never appear as sums of terms in successive triples in A329333.

Original entry on oeis.org

17, 43, 71, 103, 313, 347, 569, 601, 661, 859, 883, 1289, 1381, 1489, 1699, 1789, 1873, 2143, 2347, 2381, 2383, 2393, 2593, 2687, 2711, 2731, 2753, 2837, 3011, 3121, 3169, 3257, 3259, 3463, 3559, 3583, 3671, 3769, 3919, 4057, 4159, 4219, 4423
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2019

Keywords

Comments

Sort A328997, remove duplicates, then list the missing primes.
Since we know that the first 20000 terms of A329333 are distinct, in order to show that a prime p is missing from the sums of pairs of terms of A329333, we only need to check until the terms of A329333 exceed p.

Examples

			A329333 begins 0, 1, 2, 7, 3, 6, 4, 5, 8, 10, 11, 9, 12, 14, 15, 13, 18, 17, 19, 20, ...
so we see the primes 2, 3, 5, 13, 7, 11, 13, 13, ...  But we do not see 17, and once we have seen all the numbers below 17 in A329333, we know 17 will never appear as a sum of two terms.
		

Crossrefs

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.

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, 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
Offset: 1

Views

Author

Henry Bottomley, May 09 2000

Keywords

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

Examples

			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.
		

Crossrefs

Inverse permutation: A117922; fixed points: A117925; A117923=a(a(n)). - Reinhard Zumkeller, Apr 03 2006
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 also A076990, A243625.
See A282695 for deviation from identity sequence.
A073659 is a version where the partial sums must be primes.

Programs

  • 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
    -- Reinhard Zumkeller, Feb 14 2013
    
  • Maple
    A055265 := proc(n)
        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:
    seq(A055265(n),n=1..100) ; # R. J. Mathar, Feb 25 2017
  • 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 *)
  • 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<M. F. Hasler, Feb 11 2020

Formula

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

Extensions

Corrected by Hans Havermann, Sep 24 2002

A329450 Lexicographically earliest sequence of distinct nonnegative integers such that neither a(n) + a(n+1) nor a(n) + a(n+2) is prime for any n.

Original entry on oeis.org

0, 1, 8, 7, 2, 13, 12, 3, 6, 9, 15, 5, 10, 4, 11, 14, 16, 18, 17, 21, 19, 23, 25, 26, 20, 22, 24, 27, 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
Offset: 0

Views

Author

M. F. Hasler, based on an idea of Eric Angelini, Nov 13 2019

Keywords

Comments

Equivalently: For any three consecutive terms, there is no prime among any of the pairwise sums. Or: For any n and 0 <= i < j <= 2, a(n+i) + a(n+j) is never prime.
For any n, a term a(n) which meets the requirements always exists: For any a(n-2), a(n-1), at least one in five consecutive values of k is such that one among {a(n-2) + k, a(n-1) + k} is divisible by 2 and the other one by 3.
Conjectured to be a permutation of the nonnegative integers. The restriction to positive indices is then a permutation of the positive integers with the same property, but not the lexicographically earliest given in A329405.
See the wiki page for additional considerations and other variants. - M. F. Hasler, Nov 24 2019

Examples

			After the smallest possible initial terms, a(0) = 0, a(1) = 1, the next term must be neither a prime nor a prime - 1. The smallest possibility is a(2) = 8.
The next term must not be a prime - 1 nor a prime - 8, which excludes 2, 4, 6 on one hand, and 3 and 5 on the other hand. The smallest possibility is a(3) = 7.
		

Crossrefs

Cf. A329333 (always one odd prime among a(n+i)+a(n+j), 0 <= i < j <= 2).
Cf. A329405 (analog for positive integers).

Programs

  • Mathematica
    Nest[Block[{k = 2}, While[Nand[FreeQ[#, k], ! PrimeQ[#[[-1]] + k], ! PrimeQ[#[[-2]] + k]], k++]; Append[#, k]] &, {0, 1}, 89] (* Michael De Vlieger, Nov 15 2019 *)
  • PARI
    A329450(n,show=0,o=0,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=1: print a(o..n-1); o=1: start with a(1) = 1 (A329405). See the wiki page for more general code returning a vector: S(n,0,3) = A329450(0..n-1).

Extensions

Edited by N. J. A. Sloane, Nov 14 2019
New definition corrected by M. F. Hasler, Nov 15 2019

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

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 15 2019

Keywords

Comments

That is, there are exactly two primes among the 6 pairwise sums of any four consecutive terms.
Conjectured to be a permutation of the nonnegative numbers.
a(100) = 97, a(1000) = 1001, a(10^4) = 9997, a(10^5) = 10^5, a(10^6) = 999984 and all numbers below 999963 have appeared at that point.
See the wiki page for considerations about existence and surjectivity of the sequence and variants thereof.

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.
Now there is only one prime, 1 + 2 = 3, among the pairwise sums using {1, 2, 8}; the next term must produce exactly one additional prime as sum with these. We see that 3 is not possible (2 + 3 = 5 and 8 + 3 = 11), but a(4) = 4 is possible.
Now using {2, 8, 4} we have no prime as a pairwise sum, so the next term must produce two primes among the sums with these terms. Again, 3 would give three primes, but 5 yields exactly two primes, 2 + 5 = 7 and 8 + 5 = 13.
		

Crossrefs

Cf. A329412 (analog for positive integers), A329453 (2 primes in a(n+i)+a(n+j), i < j < 5).
Cf. A329333 (one odd prime among a(n+i)+a(n+j), 0 <= i < j < 3), A329450 (no prime in a(n+i)+a(n+j), i < j < 3).

Programs

  • PARI
    A329452(n,show=0,o=0,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(2<#p,p[^1],p),o); my(c=2-sum(i=2,#p,sum(j=1,i-1,isprime(p[i]+p[j])))); if(#p<3, o=u;next); 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 a(o..n-1); o=1: use indices & terms >= 1, i.e., compute A329412. See the wiki page for more general code returning a vector: S(n,2,4) = a(0..n-1).

Extensions

Edited (deleted comments now found on the wiki) by M. F. Hasler, Nov 24 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.

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

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

M. F. Hasler, following an idea from Eric Angelini, Nov 24 2019

Keywords

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.

Crossrefs

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

Programs

  • 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:
    R; # Robert Israel, Dec 29 2022
  • PARI
    A329425_upto(N) = S(N,6,5,0) \\ see the wiki page for the function S().

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.
Showing 1-10 of 39 results. Next