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 21-22 of 22 results.

A355166 Lexicographically earliest sequence of distinct positive integers such for any n > 0, n and a(n) are coprime and have no common 1-bits in their binary expansions.

Original entry on oeis.org

2, 1, 4, 3, 8, 17, 16, 5, 20, 21, 32, 19, 18, 33, 64, 7, 6, 13, 12, 9, 10, 41, 40, 35, 34, 37, 68, 65, 66, 97, 96, 11, 14, 25, 24, 67, 26, 73, 80, 23, 22, 85, 84, 81, 82, 129, 128, 71, 72, 69, 76, 75, 74, 137, 136, 131, 70, 133, 132, 193, 130, 257, 256, 15, 28
Offset: 1

Views

Author

Rémy Sigrist, Jun 22 2022

Keywords

Comments

This sequence combines features of A065190 and of A238757.
This sequence is a self-inverse permutation of the nonnegative integers, without fixed points.
This sequence is well defined:
- if n is odd, then we can extend the sequence with a power of 2 > n,
- if n < 2^k is even, then we can extend the sequence with a prime number of the form 1 + t*2^k (Dirichlet's theorem on arithmetic progressions guarantees us that there is an infinity of such prime numbers).
When n is odd, a(n) is even and vice-versa.

Examples

			The first terms, alongside binary expansions and distinct prime factors, are:
  n   a(n)  bin(n)  bin(a(n))  dpf(n)  dpf(a(n))
  --  ----  ------  ---------  ------  ---------
   1     2       1         10  {}      {2}
   2     1      10          1  {2}     {}
   3     4      11        100  {3}     {2}
   4     3     100         11  {2}     {3}
   5     8     101       1000  {5}     {2}
   6    17     110      10001  {2, 3}  {17}
   7    16     111      10000  {7}     {2}
   8     5    1000        101  {2}     {5}
   9    20    1001      10100  {3}     {2, 5}
  10    21    1010      10101  {2, 5}  {3, 7}
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        aset, mink = set(), 1
        for n in count(1):
            an = mink
            while an in aset or n&an or gcd(n, an)!=1: an += 1
            aset.add(an); yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 65))) # Michael S. Branicky, Jun 22 2022

A380671 a(n) is the smallest number not yet in the sequence which is coprime to n and shares at least one decimal digit with n.

Original entry on oeis.org

1, 21, 13, 41, 51, 61, 17, 81, 19, 11, 10, 23, 3, 15, 14, 31, 7, 71, 9, 27, 2, 25, 12, 29, 22, 63, 20, 83, 24, 37, 16, 33, 32, 35, 34, 43, 30, 39, 38, 47, 4, 121, 36, 45, 44, 49, 40, 85, 46, 53, 5, 55, 50, 59, 52, 57, 56, 65, 54, 67, 6, 69, 26, 141, 58, 161, 60
Offset: 1

Views

Author

Keywords

Comments

Like A065190 but with the extra condition that n and a(n) must have at least one decimal digit in common. Definition implies that a(1) = 1 is the only fixed point. Let a(n) be even then 2|a(n) -> 2!|n-> 2|(n+1)->2!|a(n+1), therefore there are no consecutive even terms. Let [n] = |n - a(n)|, then it follows from the coprime conditions of the definition that n, a(n), [n] are pairwise coprime. Sequence is conjectured to be a permutation of the natural numbers with [n] < 100 (= base^2).

Examples

			a(1) = 1 since 1 is the smallest novel number prime to 1 and sharing a digit with it so a(2) = 21 because digit 2 is shared, Gcd(2,21) = 1 and there is no smaller number with this property. a(7) = 17 implies a(17) = 7 (self inverse property).
		

Crossrefs

Cf. A065190.

Programs

  • Mathematica
    nn = 120; c[_] := True; u = 1;
    Reap[Do[s = Union@ IntegerDigits[n]; k = u;
      While[
        Nand[c[k], IntersectingQ[s, IntegerDigits[k]], CoprimeQ[n, k]],
        k++];
      Sow[k]; c[k] = False;
      If[k == u, While[! c[u], u++]], {n, nn}] ][[-1, 1]]

Formula

a(a(n)) = n for all n (sequence is self inverse).
Previous Showing 21-22 of 22 results.