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-6 of 6 results.

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

Views

Author

Keywords

Comments

This is conjectured and designed to be a permutation of the nonnegative integers, therefore the offset is taken to be zero.
Restricted to positive indices, this is a sequence of positive integers having the same property, then conjectured to be a permutation of the positive integers. (The word "odd" can be omitted in this case.)
If the word "odd" is dropped from the original definition, the sequence starts (0, 1, 3, 6, 2, 7), and then continues from a(6) = 4 onward as the present sequence. This is again conjectured to be a permutation of the nonnegative integers, and a permutation of the positive integers when restricted to the domain [1..oo). The latter however no longer has the property of lexicographic minimality.
See the OEIS wiki page for further considerations about existence, surjectivity and variants. - M. F. Hasler, Nov 24 2019

Examples

			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.
		

Crossrefs

For the primes that arise, or are missing, see A328997, A328998.
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.

Programs

  • Mathematica
    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 *)
  • PARI
    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, ...)

Extensions

Entry revised by N. J. A. Sloane, Nov 14 2019 and M. F. Hasler, Nov 15 2019

A254337 Lexicographically earliest sequence of distinct numbers such that no sum of consecutive terms is prime.

Original entry on oeis.org

0, 1, 8, 6, 10, 14, 12, 4, 20, 16, 24, 18, 22, 28, 26, 34, 30, 32, 36, 40, 42, 46, 38, 44, 52, 48, 54, 50, 58, 56, 62, 64, 60, 66, 68, 72, 70, 74, 80, 76, 78, 86, 82, 84, 90, 92, 94, 88, 98, 96, 104, 100, 102, 108, 110, 112, 114, 106, 116, 122, 118, 120, 124, 126, 130, 132, 134, 128, 138, 136, 142, 140, 144, 146, 148, 150, 154, 152, 156, 158
Offset: 0

Views

Author

M. F. Hasler, Jan 28 2015

Keywords

Comments

In other words, no sum a(i)+a(i+1)+a(i+2)+...+a(n) may be prime. In particular, the sequence may not contain any primes.
I conjecture that the sequence contains all even numbers > 2 and no odd number beyond 1. If so, we must simply ensure that the sum a(1)+...+a(n) is not prime, which is always possible for one of the three consecutive even numbers {2n, 2n+2, 2n+4}. As a consequence, it would follow that a(n) ~ 2n.
Is there even a proof that the smallest odd composite number, 9, does not appear?
The variant A254341 has the additional restriction of alternating parity, which avoids excluding the odd numbers.
The least odd composite number a'(n+1) that could occur as the next term after a(n) and such that sum(a(i),i=k...n)+a'(n+1) is composite for all k <= n is (for n = 0, 1, 2,...): 9, 9, 25, 21, 39, 25, 69, 65, 45, 119, 95, 77, 55, 27, 595, 561, 531, 865, 1519, 1479, 1437, 1391, 1353, 1309, 1257, 1209, 1155, 1105, 1047, 2317, 2255, 2191, 3565, 5719, 13067, 12995, 12925, 12851, 12771, 12695, 12617, 12531, 12449, 12365, 12275, ... The growth of this sequence shows how it is increasingly unlikely that an odd number could occur, since the next possible even term is only about 2n.

Examples

			To explain the beginning of the sequence, observe that starting with the smallest possible terms 0, 1 does not appear to lead to a contradiction (and in fact never does), so we start there.
The next composite would be 4 but 1+4=5 is prime, as is 1+6, but 1+8=9 is not, so we take a(2) = 8 to be the next term.
4 is impossible for a(3) since 1+8+4=13 is prime, but neither 1+8+6=15 nor 8+6 is prime, so a(3)=6.
		

Crossrefs

Cf. A025044 (no pairwise sum is prime), A025043 (no pairwise difference is prime).

Programs

  • Mathematica
    f[lst_List] := Block[{k = 1}, While[ PrimeQ@ k || MemberQ[lst, k] || Union@ PrimeQ@ Accumulate@ Reverse@ Join[lst, {k}] != {False}, k++]; Append[lst, k]]; Nest[f, {0}, 70] (* Robert G. Wilson v, Jan 31 2015 *)
  • PARI
    a=[];u=0; for(i=1,99, a=concat(a,0); until( ! isprime(s) || ! a[i]++, while( isprime(a[i]) || bittest(u,a[i]), a[i]++); s=a[k=i]; while( k>1 && ! isprime( s+=a[k--]),)); u+=2^a[i]; print1(a[i]","))

Formula

It appears that a(n) ~ 2n.

A025043 a(n) is not of the form prime + a(k), k < n.

Original entry on oeis.org

0, 1, 9, 10, 25, 34, 35, 49, 55, 85, 91, 100, 115, 121, 125, 133, 145, 155, 169, 175, 187, 195, 205, 217, 235, 247, 253, 259, 265, 289, 295, 301, 309, 310, 319, 325, 335, 343, 355, 361, 375, 385, 391, 395, 403, 415, 425, 445, 451, 469, 475, 481, 485, 493, 505, 511, 515
Offset: 1

Views

Author

Keywords

Comments

Since this sequence includes 0 no terms are prime. - Charles R Greathouse IV, Jul 25 2013
Lexicographically earliest sequence of distinct natural numbers such that no two terms differ by a prime. - Peter Munn, Jun 19 2017
Congruence analysis from Peter Munn, Jun 30 2017: (Start)
If a(k) is in congruence class q mod p for some prime p, a(k) + p is the only higher number in this class that can be written as prime + a(k). Thus the ways a number m can be written as prime + a(k) for some k are much constrained if m shares membership of one or more such congruence classes with all except a few of the smaller terms in the sequence.
Of the first 100 terms, congruence class 1 mod 2 (odd numbers) contains 95, 1 mod 3 contains 76, and 0 mod 5 contains 53. No other congruence class modulo a prime contains more than 23.
The only even terms up to a(10000) are 0, 10, 34, 100, 310; of which 10, 100 and 310 are congruent to 10 mod 30, therefore to both 1 mod 3 and 0 mod 5. Note an initial sparseness of terms not congruent to either 1 mod 3 or 0 mod 5: this subsequence starts 9, 309, 527, 899, 989, 999. It becomes less sparse: as a proportion of the main sequence it is 0.04, 0.086 and 0.1555 of the first 100, 1000 and 10000 terms respectively.
Conjecture: there are only finitely many even terms.
(End)

Crossrefs

A068638 a(1) = 1, a(n) = smallest distinct composite number such that a(n) + a(k) is a composite number for all k = 1 to n.

Original entry on oeis.org

1, 8, 14, 20, 24, 25, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 86, 90, 92, 94, 98, 104, 110, 116, 118, 120, 122, 128, 134, 140, 144, 146, 152, 158, 160, 164, 170, 176, 182, 184, 188, 194, 200, 206, 212, 218, 220, 224, 230, 234, 236, 242, 248, 254, 260, 264, 266
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Comments

Conjecture: 25 is the largest odd term of this sequence.
Essentially the same as A025044. - R. J. Mathar, Sep 30 2008

Examples

			a(2) = 8 as for the smaller composite numbers 4 and 6 one gets 4 + 1 = 5 and 6 + 1 = 7, both primes. a(3) = 14 as 1 + 14 = 15 and 8 + 14 = 22 are composite.
		

Crossrefs

Cf. A025044.

Programs

  • Mathematica
    a1 = {0}; nmax = 266; Do[ If[Select[n + a1, PrimeQ] == {}, AppendTo[a1, n]] , {n, nmax}]; Rest[a1] (* Ray Chandler, Jan 15 2017 *)
  • Python
    from sympy import isprime
    from itertools import islice
    def agen(start=1): # generator of terms
        alst, k, sums = [0, start], 2, {0} | {start}
        while True:
            yield alst[-1]
            while any(isprime(k+an) for an in alst): k += 1
            alst.append(k)
            k += 1
    print(list(islice(agen(), 60))) # Michael S. Branicky, Dec 15 2022

Extensions

More terms from Sascha Kurz, Mar 17 2002
Description clarified by Ray Chandler, Jan 15 2017

A075570 Lexicographically earliest sequence of distinct composite numbers such that a(k) + a(k+1) is prime for all k.

Original entry on oeis.org

4, 9, 8, 15, 14, 27, 10, 21, 16, 25, 6, 35, 12, 49, 18, 55, 24, 65, 32, 39, 20, 33, 26, 45, 22, 51, 28, 69, 34, 63, 38, 75, 52, 57, 40, 87, 44, 93, 46, 81, 50, 77, 30, 119, 48, 91, 36, 95, 42, 85, 54, 125, 56, 111, 62, 105, 58, 99, 64, 115, 66, 133, 60, 121, 70, 123, 68, 129, 82
Offset: 1

Views

Author

Amarnath Murthy, Sep 25 2002

Keywords

Comments

Index of composite values: {1, 4, 3, 8, 7, 17, 5, 12, 9, 15, 2, 23, 6, 33, 10, 38, 14, 46, 20, 26, 11, 21, 16, 30, ...}. - Michael De Vlieger, Jul 18 2017

Crossrefs

Programs

  • Mathematica
    a = {4}; Do[k = 2 - Boole@ EvenQ@ n; While[Nand[! MemberQ[a, k], CompositeQ@ k, PrimeQ[a[[n - 1]] + k]], k += 2]; AppendTo[a, k], {n, 2, 69}]; a (* Michael De Vlieger, Jul 18 2017 *)

Extensions

More terms from David Wasserman, Jan 20 2005
Definition clarified by Peter Munn, Jul 20 2017

A072545 a(0) = 1, a(n) for n > 0 is the smallest number > a(n-1) such that a(n)-a(k) is nonprime for 0 <= k < n.

Original entry on oeis.org

1, 2, 10, 11, 26, 35, 36, 50, 56, 86, 92, 101, 116, 122, 126, 134, 146, 156, 170, 176, 188, 196, 206, 218, 236, 248, 254, 260, 266, 290, 296, 302, 310, 311, 320, 326, 336, 344, 356, 362, 376, 386, 392, 396, 404, 416, 426, 446, 452, 470, 476, 482, 486, 494
Offset: 0

Views

Author

Amarnath Murthy, Aug 04 2002

Keywords

Comments

a(0) = 1, a(3) = 11, a(5) = 35, a(11) = 101 and a(33) = 311 are the only odd elements <= 10^6 and probably the only ones. If so, then for n >= 34, a(n) is the smallest even k >= a(n-1)+4 for which none of k-1, k-11, k-35, k-101 or k-311 is prime. - David W. Wilson, Dec 14 2006

Examples

			26 is the smallest number > 11 which differs from 1, 2, 10, 11 by a nonprime (25, 24, 16, 15), so 26 is the next term after 11.
		

Crossrefs

Programs

  • PARI
    print1(a=1,","); v=[1]; n=1; while(n<55,a++; k=1; while(k<=n&&!isprime(a-v[k]), k++); if(k>n,n++; v=concat(v,a); print1(a,",")))

Extensions

Edited and extended by Klaus Brockhaus, Aug 09 2002
Showing 1-6 of 6 results.