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

A103683 a(1)=1, a(2)=2, a(3)=3, a(n) = smallest positive integer not occurring earlier in sequence and coprime to a(n-1), a(n-2) and a(n-3).

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 9, 11, 13, 8, 15, 17, 19, 14, 23, 25, 27, 16, 29, 31, 21, 10, 37, 41, 33, 20, 43, 47, 39, 22, 35, 53, 51, 26, 49, 55, 57, 32, 59, 61, 45, 28, 67, 71, 65, 6, 73, 77, 79, 12, 83, 85, 89, 18, 91, 95, 97, 24, 101, 103, 107, 30, 109, 113, 119, 36, 115, 121, 127, 34
Offset: 1

Views

Author

Leroy Quet, Mar 26 2005

Keywords

Comments

Conjectured to be not a permutation of the natural numbers.
Charles R Greathouse IV extended this, and confirms that primes occur in natural order. - Jonathan Vos Post and M. F. Hasler, Jan 18 2011
Conjecture: for n >= 67, a(n) is even if and only if n == 2 (mod 4) and divisible by 3 if and only if n == 3 (mod 4). In particular, this implies the last value divisible by 6 is a(66) = 36. - Robert Israel, May 12 2015
a(102982) = 42, see A105214. Conjecture above is false. - Sergio Pimentel, Apr 18 2022

Crossrefs

Programs

  • Maple
    ina:= proc(n) false end:
    a:= proc(n) option remember; local k;
          if n<4 then k:= n
        else for k from 4 while ina(k) or igcd(k, a(n-1))<>1 or
                    igcd(k, a(n-2))<>1 or igcd(k, a(n-3))<>1
             do od
          fi; ina(k):= true; k
        end:
    seq(a(n), n=1..120);  # Alois P. Heinz, Jan 19 2011
  • Mathematica
    f[s_] := Block[{k = 1, l = Take[s, -3]}, While[ Union[ GCD[k, l]] != {1} || MemberQ[s, k], k++]; Append[s, k]]; Nest[f, {1, 2, 3}, 70] (* Robert G. Wilson v, Jun 26 2011 *)
  • Python
    from math import gcd
    from itertools import islice
    def agen(): # generator of terms
        aset, b, c, d = {1, 2, 3, 5}, 2, 3, 5
        yield from [1, b, c, d]
        while True:
            k = 1
            while k in aset or any(gcd(t, k) != 1 for t in [b, c, d]): k+= 1
            b, c, d = c, d, k
            aset.add(k)
            yield k
    print(list(islice(agen(), 70))) # Michael S. Branicky, Apr 18 2022

Extensions

More terms from Robert G. Wilson v, Mar 30 2005

A354717 Lexicographically earliest infinite sequence of distinct positive integers such that in any run of four consecutive terms there is one term which is prime to the other three, none of which are pairwise coprime.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Jun 03 2022

Keywords

Comments

Can be regarded as the reverse of A354732, which has the opposite coprime relations to those defined here. Records tend to be nonprime, but not all nonprimes are records.
The primes do not appear in natural order (5 and 7 precede 3).
Open question: Is it true that in any run of four consecutive terms there is always a prime or prime power (this being the term prime to the other three)?
Conjecture: Sequence is a permutation of the positive integers.

Examples

			a(1,2,3,4) = 1,2,4,6 is the lexicographically earliest string of four consecutive numbers which satisfy the definition, hence the sequence starts with these terms.
a(13,14,15) = 7,20,15 respectively, and 24 is the least unused number such that 7 is prime to 20,15 and 24, whereas (20,15)=5, (15,24)=3 and (20,24)=2. Therefore a(16)=24.
		

Crossrefs

Programs

A354732 Lexicographically earliest infinite sequence of distinct positive integers such that in any run of four consecutive terms there is only one pair of terms which share a prime divisor, the rest are all pairwise coprime.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Jun 04 2022

Keywords

Comments

Can be regarded as the reverse of A354717, which has the opposite coprime relations to those defined here. Primes tend to be records but not all records are primes (8, 16 are nonprime records; 11,13 are primes but not records).
Conjecture: Sequence is a permutation of the positive integers in which the primes appear in their natural order.

Examples

			a(1,2,3,4) = 1,2,3,4 is the lexicographically earliest string of four consecutive terms which satisfy the definition, hence sequence starts with these terms.
a(12,13,14) = 10,17,6 respectively, and 19 is the smallest term not already seen in the sequence such that 10,17,6,19 satisfy the definition ((10,6)=2, and (10,17)=(10,19)=(17,19)=(17,6)=(6,19)=1); therefore a(15)=19.
		

Crossrefs

Programs

Extensions

More terms from David A. Corneth, Jun 05 2022

A352849 a(n) is the least k not already in the sequence such that k is pairwise coprime to a(n-1) and a(n-2), starting with a(1) = 1, a(2) = 3, and a(3) = 5.

Original entry on oeis.org

1, 3, 5, 2, 7, 9, 4, 11, 13, 6, 17, 19, 8, 15, 23, 14, 25, 27, 16, 29, 21, 10, 31, 33, 20, 37, 39, 22, 35, 41, 12, 43, 47, 18, 49, 53, 24, 55, 59, 26, 45, 61, 28, 51, 65, 32, 57, 67, 34, 63, 71, 38, 69, 73, 40, 77, 79, 30, 83, 89, 36, 85, 91, 44, 75, 97, 46, 81
Offset: 1

Views

Author

Michael De Vlieger, Apr 14 2022

Keywords

Comments

Sequence begins with 1 and the first 2 odd primes.
a(3k+1) is even for k > 0 as consequence of definition and since 2 is the smallest prime and numbers are either even or odd. Unlike A085229, even numbers in this sequence do not appear in order. Hence a(3k) and a(3k+2) are odd.
The smallest missing number u is even, and there is a smallest missing odd number v that applies to a(3k) and a(3k+2).
Let q be odd and prime. In a given interval i <= n <= j, we either have 2q | a(n) or we have q | a(n) odd.
Regarding 6 | a(n), there are phases i <= n <= j where 6 | a(3k+1) and no a(n) mod 6 = 3 appear. These begin when 3 | a(3k+1) and prevent the entry of 3 | v. Whereupon all u such that 6 | u have been consumed, 3 | a(3k+r), r != 1 occurs, and we move into a phase where we have a(n) mod 6 = 3, but no 6 | a(3k+1) appear. This occurs until all v such that 3 | v have been consumed, and 3 | a(3k+1) once again.
Conjecture: the sequence is a permutation of the natural numbers.

Crossrefs

Programs

  • Maple
    ina := proc(n) false end: # adapted from code for A352950
    a := proc (n) option remember; local k;
    if n < 4 then k := 2*n-1
    else for k from 2 while ina(k) or igcd(k, a(n-1)) <> 1 or igcd(k, a(n-2)) <>1
    do
    end do
    end if; ina(k):= true; k
    end proc:
    seq(a(n), n = 1 .. 100); # -David James Sycamore, Apr 17 2022
  • Mathematica
    nn = 66, c[_] = 0; Array[Set[{a[#1], c[#2]}, {#2, #1}] & @@ {#, 2 # - 1} &, 3]; u = 2; Do[k = u; m = LCM @@ Array[a[i - #] &, 2]; While[Nand[c[k] == 0, CoprimeQ[m, k]], k++]; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 4, nn}]; Array[a, nn]
  • Python
    from math import gcd
    from itertools import islice
    def agen(): # generator of terms
        aset, b, c = {1, 3, 5}, 3, 5
        yield from [1, b, c]
        while True:
            k = 1
            while k in aset or any(gcd(t, k) != 1 for t in [b, c]): k+= 1
            b, c = c, k
            aset.add(k)
            yield k
    print(list(islice(agen(), 68))) # Michael S. Branicky, Apr 14 2022
Showing 1-4 of 4 results.