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

A280985 a(1)=1, and then a(n) = smallest positive integer not occurring earlier in the sequence sharing some prime factor with at least one of a(n-1) and a(n+1).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 12 2017

Keywords

Comments

In other words, for any n>1, gcd(a(n), a(n-1))*gcd(a(n), a(n+1)) > 1.
This sequence is related to A127202: here we require that the derived sequence b(n) = gcd(a(n), a(n+1)) does not contain two consecutive ones, there we require that the derived sequence c(n) = gcd(A127202(n), A127202(n+1)) (see A127203) does not contain two consecutive equal values; this sequence first differs from A127202 at n=720: a(720)=666 whereas A127202(720)=667.
This sequence is also related to the EKG sequence (A064413): here we require a common prime factor with at least one neighbor, there we require a common prime factor with both neighbors.
This sequence is a permutation of the natural numbers, with inverse A281117: Proof:
- The sequence is injective by definition,
- The sequence is surjective: by contradiction: let m be the least value missing from the sequence, and n0 the least value such that a(n)>m for any n>=n0; if a(n0) shares a prime factor with a(n0-1), then we can choose a(n0+1)=m; if a(n0) does not share a prime factor with a(n0-1), then a(n0+1) shares a prime factor with a(n0), and we can choose a(n0+2)=m: contradiction. QED

Examples

			The first terms, alongside the GCD with the next term, are:
n     a(n)     GCD
-     ----     ---
1        1       1
2        2       2
3        4       1
4        3       3
5        6       1
6        5       5
7       10       1
8        7       7
9       14       2
10       8       1
11       9       3
12      12       1
13      11      11
14      22       1
...    ...     ...
717    661     661
718   1322       2
719    664       2
720    666       1
721    667      23
		

Crossrefs

Cf. A064413, A127202 (agrees for first 719 terms), A127203, A281117, A283312.
For fixed points see A281353, for indices of primes see A338352.

Programs

  • Mathematica
    f[s_List] := Block[{g = GCD[s[[-2]], s[[-1]]], k = 3}, While[ MemberQ[s, k] || GCD[s[[-1]], k] == g, k++]; Append[s, k]]; Nest[f, {1, 2}, 65] (* Robert G. Wilson v, Mar 03 2017 *)

Formula

The following heuristic argument explains why the graph of this sequence is almost identical to the graph of A283312. Numbers appear in the sequence in their natural order, except when interrupted either by the appearance of a prime p, which is always followed by 2*p, or by a composite number c which needs to be followed by a missing number c' with gcd(c, c') > 1 (a(29) = 25 = c with a(30) = 30 = c' is an example). But c' is normally close to c, so those displacements have only a small local effect compared with the larger displacements caused by the primes. So the two lines in the graph are essentially defined by the same equations as the two lines in the graph of A283312. - N. J. A. Sloane, Nov 03 2020

A127202 a(1)=1, a(2)=2; a(n) = the smallest positive integer not occurring earlier in the sequence such that gcd(a(n), a(n-1)) does not equal gcd(a(n-1), a(n-2)).

Original entry on oeis.org

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

Views

Author

Leroy Quet, Jan 08 2007

Keywords

Comments

This sequence appears to be a permutation of the positive integers. - Leroy Quet, Jan 08 2007
From N. J. A. Sloane, Jan 26 2017: (Start)
Theorem: This is a permutation of the positive integers.
Proof: (Outline. For details see the link.)
1. Sequence is infinite.
2. For all m, either m is in the sequence or there exists an n_0 such that for n >= n_0, a(n) > m.
3. For all primes p, there is a term divisible by p.
4. For all primes p, there are infinitely many multiples of p in the sequence.
5. Every prime appears in the sequence.
6. For any number m, there are infinitely many multiples of m in the sequence.
7. Every number m appears in the sequence.
(End)
Comment from N. J. A. Sloane, Feb 28 2017: (Start)
There are several short cycles and at least one apparently infinite orbit:
[1], [2], [3, 4], [5, 6], [7, 10, 8],
[9, 14, 22, 19, 16, 26, 24, 20, 17, 15, 13, 11],
[21, 34, 29, 25],
and the first apparently infinite orbit is, in the forward direction,
[23, 38, 33, 32, 28, 46, 41, 40, 35, 58, 51, 45, 42, 37, 62, 106, ...] (see A282712), and in the reverse direction
[23, 27, 31, 36, 39, 44, 50, 57, 65, 73, 82, 47, 53, 61, 68, 77, ...] (see A282713). (End)
Conjecture: The two lines in the graph are (apart from small local deviations) defined by the same equations as the two lines in the graph of A283312. - N. J. A. Sloane, Mar 12 2017

Examples

			gcd(a(7), a(8)) = gcd(10,7) = 1. So a(9) is the smallest positive integer which does not occur earlier in the sequence and which is such that gcd(a(9), 7) is not 1. So a(9) = 14, since gcd(14,7) = 7.
		

Crossrefs

Agrees with A280985 for first 719 terms.
For fixed points see A281353. See also A282712, A282713.

Programs

  • Mathematica
    f[l_List] := Block[{k = 1, c = GCD[l[[ -1]], l[[ -2]]]},While[MemberQ[l, k] || GCD[k, l[[ -1]]] == c, k++ ];Append[l, k]];Nest[f, {1, 2}, 69] (* Ray Chandler, Jan 16 2007 *)
  • PARI
    \\ based on Rémy Sigrist's program for A280985
    { seen = 0; p = 1; g = 2;
            for (n=1, 10000,
                    a = 1;
    while (bittest(seen, a) || (n>2 && gcd(p,a)==g), a++; );
                    print (n " " a);
                    g = gcd(p,a);
                    p = a;
                    seen += 2^a;
            )
    }

Extensions

Extended by Ray Chandler, Jan 16 2007
Showing 1-2 of 2 results.