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.

Previous Showing 11-20 of 32 results. Next

A352588 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1) but does not equal a(n-1)+1.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 29 2022

Keywords

Comments

Theorem: This is a permutation of the natural numbers. The proof is essentially the same as for A093714. - N. J. A. Sloane, May 02 2022
Coincides with A093714 for n >= 17. - Scott R. Shannon, May 02 2022.
In the first 100 million terms the sequence's values are concentrated along the line a(n) = n, resulting in 1160 fixed points in this range. However the last fixed point in this range is a(1034312), with the sequence oscillating above and below the line a(n) = n from then on. It is unknown if this behavior continues or if more fixed points eventually appear.
The largest offset in the first 100 million terms from the line a(n) = n is a(45902952) = 45902981, with an offset of 29. In this range a number is rejected as the next term on 207 occasions as it equals a(n-1)+1.
Beyond a(4) = 3 the primes appear in their natural order.
From Michael De Vlieger, May 01 2022: (Start)
Theorem: if prime p | a(n-1) then p does not divide a(n). Proof: primes either divide or are coprime to a given number. We say numbers m and n are coprime iff gcd(m,n) = 1. Suppose p | a(n-1) and p | a(n), then p | m, where m = gcd(a(n-1), a(n)). By definition of prime and divisor, m > 1, a contradiction.
Corollary: even terms do not appear adjacently in the sequence, however we may have runs of odd terms.
Theorem: fixed point a(n) = n implies a(n) and n have the same parity. Proof: a(n) = n iff a(n) mod n = 0, since n | n. Suppose prime q|n yet gcd(a(n), q) = 1, then a(n) != n, a contradiction.
Observation: there are 9 runs of odd terms for n = 1..2^28, one of 3 odd terms {5, 3, 7}, the rest of 2. Fixed points appear in intervals [1, 3], [4, 17], [78, 1787], [15022, 38123], and [45053, 1036043]. The last run of odd terms for n <= 2^28 begins at n = 1036043. Is there another run of odd terms that will begin a new interval that harbors fixed points? (End)

Examples

			a(3) = 5 as a(2) = 2, and the smallest unused number coprime to 2 that does not equal 2+1=3 is 5.
		

Crossrefs

Programs

  • Mathematica
    nn = 76; c[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = 2; u = 3
    Do[k = u; While[Nand[c[k] == 0, CoprimeQ[#, k], k != # + 1], k++] &@ a[i - 1]; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, May 01 2022 *)

A356851 a(1) = 1, a(2) = 2, a(3) = 4; for n > 3, a(n) is the smallest positive number not occurring earlier such that a(n) shares a factor with the previous Omega(a(n)) terms.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 15, 5, 10, 20, 14, 7, 21, 28, 35, 30, 25, 40, 45, 50, 18, 22, 8, 16, 24, 26, 13, 39, 52, 65, 78, 60, 33, 11, 44, 55, 66, 70, 34, 17, 51, 68, 85, 102, 90, 38, 19, 57, 76, 95, 114, 110, 46, 23, 69, 92, 115, 138, 130, 58, 29, 87, 116, 145, 174, 150, 62, 31, 93, 124, 155, 186
Offset: 1

Views

Author

Scott R. Shannon, Aug 31 2022

Keywords

Comments

For n > 250 the terms are concentrated along seven lines, see the linked images. Unlike the other six lines, numbers along the second lowest line are somewhat spread out, and these terms contain all numbers with Omega(a(n)) > 1. The lowest line contains all the primes, while the upper five lines contain terms with Omega(a(n)) = 2, 3, and 4. The primes up to n=100000 occur in their natural order except for 11 and 13 which are switched. The only fixed point beyond the first two terms is 10, and it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(8) = 15 as Omega(15) = A001222(15) = 2, and 15 shares a factor with the previous two terms, namely a(6) = 9 and a(7) = 12.
		

Crossrefs

Cf. A064413, A356850 (coprime to previous Omega(a(n)) terms), A001222, A093714, A336957, A000040

A085229 Smallest number which is coprime to n and to a(n-1), and is not yet in the sequence; a(1)=1.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 22 2003

Keywords

Comments

Permutation of natural numbers with inverse A085230: a(A085230(n))=A085230(a(n))=n.
From Michael De Vlieger, Apr 13 2022: (Start)
Theorem 1: 2 | a(2k+1) for k > 0, consequence of the lexically earliest and coprimality axioms. Even numbers appear in order as a consequence of the latter axiom and since numbers are either even or odd.
Corollary: the only fixed point is a(1) = 1.
Theorem 2: Generally, if prime p | a(n) then p is coprime to a(n +/- 1). For p = 2, 2 | a(2k+1) for k > 0 since 2 is the smallest prime. For odd p it is not necessarily true that given p | a(n) -> p | a(n+2) or p | a(n-2), since there may be a smaller m such that (a(n-1), m) = 1, q | m for prime q < p, and is not in a(1..n-1).
For these reasons, if we also set a(2) = 3, then we need not also check (n, a(n)) = 1, since it isn't possible. If we do not check (n, a(n)) = 1 and set a(2) = 3, 2 would follow 1 since 1 is coprime to all numbers.
Theorem 3: 3 | a(3k+1) for k > 1. Proof: For even k, 6 | a(3k+1), i.e., 6 | a(n) : n mod 6 = 1, and it is easy to see that since even numbers appear in order in the sequence, these even multiples of 3 are also in order. Because 3 | a(n) : n mod 6 = 1, we cannot have 3 | a(n) for n congruent to 0 or 2 (mod 6). Furthermore, we know that 2 | a(n) for n congruent to 3 or 5 (mod 6). So 3 | a(n) odd : n mod 6 = 4, that is, 3 | a(3k+1) for k > 1.
Theorem 4: Odd primes q set records. Proof: (q, a(n-1)) = 1 as a consequence of lexically earliest axiom that rules out equality, and by the definition of prime. 2 is displaced on account of the axiom that bans equality between n and a(n). Therefore, whereupon q is the smallest unused odd number, it enters the sequence.
A consequence of theorems 1 and 3 is that powers of 2 and those of 3 excepting 3 itself do not set records, since their adjacency is governed by a(n-1). The powers of other primes do set records since coprimality does not depend on multiplicity.
The smallest composite record is a(24) = 25. Smallest record m with omega(m) > 1 is a(54) = 55. Powers of 2 and 3 are absent from records for n <= 2^20. (End)

Crossrefs

Programs

A354688 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1) and the difference | a(n) - a(n-1) | is distinct from all previous differences.

Original entry on oeis.org

1, 2, 5, 3, 7, 12, 19, 4, 13, 21, 8, 25, 6, 17, 11, 23, 9, 29, 39, 10, 31, 15, 37, 14, 41, 16, 47, 65, 18, 53, 20, 57, 83, 22, 61, 27, 55, 79, 24, 67, 26, 71, 33, 73, 43, 75, 119, 30, 89, 32, 81, 28, 93, 35, 86, 149, 34, 101, 45, 91, 127, 36, 107, 38, 111, 49, 97, 139, 40, 117, 167, 42, 121, 46
Offset: 1

Views

Author

Scott R. Shannon, Jun 03 2022

Keywords

Comments

All of the terms are concentrated along four lines - this is in contrast to A352588 where they all concentrated along one line. See the linked image. The primes do not occur in their natural order. The sequence is conjectured to be a permutation of the positive integers.
See A354731 for the differences between terms.

Examples

			a(6) = 12 as a(5) = 7, and 12 is the smallest unused number that is coprime to 7 and whose difference from the previous term, | 12 - 7 | = 5, has not appeared. Note that 4,6,8,9,10,11 are all coprime to 7 but their differences from 7 have all appeared as differences between previous terms so none can be chosen.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = d[] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jun 04 2022 *)
  • Python
    from math import gcd
    from sympy import isprime, nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, diffset, an, mink = {1}, set(), 1, 2
        yield 1
        for n in count(2):
            k = mink
            while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1
            aset.add(k); diffset.add(abs(k-an)); an = k; yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 74))) # Michael S. Branicky, Jun 04 2022

A097465 a(1) = 1; for n>1, a(n) = smallest positive integer which is not among earlier terms of sequence, is coprime to a(n-1) and is not equal to a(n-1) +- 1.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Aug 23 2004

Keywords

Comments

A permutation of the positive integers. [This follows easily by standard arguments. One shows that all primes appear. If a number k is missing, find a prime term P that is much greater than k. Then the term following P will be k. Contradiction. - N. J. A. Sloane, May 06 2022]

Examples

			a(8) = 11 because, among the positive integers not occurring earlier in the sequence (6,8,10,11,12,...), 11 is the smallest which is coprime to a(7)=9, is not a(7)+1=10 and is not a(7)-1=8.
		

Crossrefs

Programs

  • Maple
    A:=proc(n) option remember; local t, S; S:=({$1..1000} minus {seq(A(i),i=1..n-1)}) minus {A(n-1)-1,A(n-1)+1}; t:=min(S[]); while igcd(A(n-1),t)>1 do S:=S minus {t}; t:=min(S[]) od; t end: A(1):=1: seq(A(n), n=1..200); # Alec Mihailovs (alec(AT)mihailovs.com), Aug 23 2004
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{t = Table[ a[i], {i, n - 1}], k = 2}, While[k == a[n - 1] - 1 || k == a[n - 1] + 1 || GCD[a[n - 1], k] != 1 || Position[t, k] != {}, k++ ]; k]; Table[ a[n], {n, 50}] (* Robert G. Wilson v, Aug 23 2004 *)
  • Python
    from math import gcd
    from itertools import islice
    def agen(): # generator of terms
        an, aset, mink = 1, {1}, 2
        while True:
            yield an
            k = mink
            while k in aset or gcd(an, k) != 1 or abs(k-an) == 1: k += 1
            an = k
            aset.add(an)
            while mink in aset: mink += 1
    print(list(islice(agen(), 72))) # Michael S. Branicky, May 02 2022

Extensions

More terms from Alec Mihailovs (alec(AT)mihailovs.com) and Robert G. Wilson v, Aug 23 2004

A356850 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number not occurring earlier such that a(n) is coprime to the previous Omega(a(n)) terms.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 10, 11, 13, 6, 17, 19, 14, 15, 23, 22, 21, 25, 26, 29, 27, 31, 8, 33, 35, 34, 37, 39, 38, 41, 43, 45, 28, 47, 51, 46, 49, 53, 55, 12, 59, 61, 57, 20, 67, 69, 58, 65, 71, 62, 63, 73, 74, 77, 75, 79, 52, 83, 85, 81, 44, 89, 87, 82, 91, 93, 86, 95, 97, 94, 99, 101, 103, 50, 107
Offset: 1

Views

Author

Scott R. Shannon, Aug 31 2022

Keywords

Comments

The terms are concentrated along lines that contain numbers with a lowest prime factor of 2 or 3. Two of these lines are initially separated but join after approximately 130000 terms. This combined line then joins the uppermost line, which contains numbers with all prime factors and has a gradient of ~1.59, after approximately 680000 terms at which point a new series of smaller values appears. See the linked images.
Numbers with a larger number of prime divisors relative to the numbers close to it appear much later in the sequence. For example a(4014) = 16, a(14219) = 40, while even more delayed are a(685301) = 24 and a(704634) = 36. These last two appear after the above mentioned line merging after 680000 terms.
The lower lines containing terms with prime factors of 2 and 3 visible in the image of terms up to 1000000 are curving upward, possibly repeating the earlier behavior seen where similar lines eventually join with the uppermost line. If these do in fact eventually reach the uppermost line it is plausible this will once again signal the start of a new series of much lower valued terms.
The two lowest unseen numbers after 1000000 terms are 32 and 48, for former indicating that the longest run of consecutive odd values is only four after 1000000 terms. Although the sequence is conjectured to be a permutation of the positive integers, if these missing terms, especially those of the form 2^k, only appear after the recombination of the lower lines with the upper line then it may take an extraordinarily large number of terms for some values, like 2^k for large k, to eventually appear.
In the first 1000000 terms the only fixed points are the first three terms along with 14 and 15. It is possible more exist if the above mentioned upward trend of smaller values does occur.

Examples

			a(7) = 9 as Omega(9) = A001222(9) = 2, and 9 is coprime to the previous two terms, namely a(6) = 7 and a(5) = 4.
		

Crossrefs

Programs

A352932 Where the parity of A352931 changes.

Original entry on oeis.org

1, 2, 11, 18, 79, 1788, 15023, 38124, 45053, 1036044, 100280245077
Offset: 1

Views

Author

N. J. A. Sloane, May 04 2022

Keywords

Comments

The terms 15023, 38124, 45053, 1036044 are based on the comments from Scott R. Shannon and Michael De Vlieger in A352588.
In fact a(n) = A351498(n) + 1, although this requires proof (see A351498).

Crossrefs

Programs

  • C
    See Links section.

Extensions

a(9) corrected and a(11) added by Rémy Sigrist, May 06 2022

A354731 Absolute values of first differences of A354688.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jun 04 2022

Keywords

Comments

See A354688 for further details.

Examples

			a(3) = 2 as | A354688(4) - A354688(3) | = | 3 - 5 | = 2.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = d[] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; {1}~Join~Reap[Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; Sow[Abs[k - j]]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]][[-1, -1]] (* Michael De Vlieger, Jun 04 2022 *)
  • Python
    from math import gcd
    from sympy import isprime, nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, diffset, an, mink = {1}, set(), 1, 2
        for n in count(2):
            k = mink
            while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1
            aset.add(k); diffset.add(abs(k-an)); yield abs(k-an); an = k
            while mink in aset: mink += 1
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 04 2022

A356903 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number not occurring earlier such that a(n) is coprime to the previous tau(a(n)) terms.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 9, 11, 13, 17, 8, 15, 19, 23, 29, 14, 25, 27, 31, 37, 22, 35, 39, 41, 43, 34, 47, 21, 53, 55, 26, 49, 51, 59, 61, 10, 67, 33, 71, 73, 38, 65, 69, 77, 79, 58, 83, 57, 85, 89, 46, 91, 87, 95, 97, 62, 101, 103, 81, 107, 74, 109, 113, 93, 115, 82, 119, 121, 111, 125, 86, 127, 131, 123
Offset: 1

Views

Author

Scott R. Shannon, Sep 03 2022

Keywords

Comments

The terms are concentrated along various lines that contain numbers with a lowest prime factor of 2, 3 or 5. These lines appear to have a slight upward curvature. However the uppermost line, which has a gradient of ~1.22, contains numbers with all prime factors. See the linked images.
Numbers with a large number of divisors relative to the numbers close to it appear much later in the sequence. For example a(96) = 6, a(1873) = 12, a(2328) = 18, a(192) = 16. The sequence is conjectured to be a permutation of the positive integers although it may take a very large number of terms for some values to appear, e.g., after 500000 terms numbers such as 24, 30, 36 have not occurred. In the same range the longest run of consecutive odd values is seven, while the only fixed points are the first three terms, although it is possible others exist for very large values of n if the smaller terms continue to increase relative to the uppermost line.

Examples

			a(7) = 9 as tau(9) = A000005(9) = 3, and 9 is coprime to the previous three terms, namely a(6) = 4, a(5) = 7 and a(4) = 5.
		

Crossrefs

A366908 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 1, a(n) shares a factor with n but does not equal n, while not sharing a factor with a(n-1).

Original entry on oeis.org

1, 4, 9, 2, 15, 8, 21, 10, 3, 5, 22, 27, 26, 7, 25, 6, 85, 12, 95, 14, 33, 16, 69, 28, 45, 13, 18, 35, 58, 39, 155, 24, 11, 17, 20, 51, 74, 19, 36, 55, 82, 49, 86, 77, 30, 23, 94, 57, 56, 65, 34, 91, 106, 63, 40, 119, 38, 29, 118, 75, 122, 31, 81, 32, 105, 44, 201, 46, 87, 50, 213, 52, 219, 37
Offset: 1

Views

Author

Scott R. Shannon, Oct 27 2023

Keywords

Comments

To ensure the sequence is infinite a(n) must be chosen so that it does not have as prime factors all the distinct prime factors of n+1. The first time this rule is required is when determining a(15); see the examples below.
For the terms studied the primes appear in their natural order except for 11 and 13 which are reversed. The sequence is conjectured to be a permutation of the positive integers.
Observation: apart from a(4) = 2, a(9) = 3, and a(33) = 11, prime a(n) is such that n is congruent to +- 2 (mod 12). - Michael De Vlieger, Oct 29 2023

Examples

			a(4) = 2 as 2 does not equal 4, shares the factor 2 with 4 while not sharing a factor with a(3) = 9.
a(15) = 25 as 25 does not equal 15, shares the factor 5 with 15 while not sharing a factor with a(14) = 7. Note that 6 is unused and satisfies these requirements but as 15 + 1 = 16 = 2^4 only contains 2 as a distinct prime factor, a(15) cannot also contain 2 as a factor else a(16) would not exist.
		

Crossrefs

Programs

  • Mathematica
    nn = 1000;
      c[] := False; m[] := 1;
      f[x_] := f[x] = Times @@ FactorInteger[x][[All, 1]];
      a[1] = 1; j = a[2] = 4; c[1] = c[4] = True; u = 2;
      Do[k = u;
        If[PrimePowerQ[n], p = FactorInteger[n][[1, 1]]; k = m[p];
         While[
          Or[c[#], ! CoprimeQ[j, #], Divisible[#, f[n + 1]], # == n] &[k p],
           k++]; k *= p; While[c[p m[p]], m[p]++],
        While[
          Or[c[k], ! CoprimeQ[j, k], CoprimeQ[k, n], Divisible[k, f[n + 1]],
            k == n], k++] ];
        Set[{a[n], c[k], j}, {k, True, k}];
        If[k == u, While[c[u], u++]], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 29 2023 *)
Previous Showing 11-20 of 32 results. Next