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.

A238757 Lexicographically earliest sequence of distinct positive integers such that for any n>0 we have (a(n) AND n) = 0 (where AND stands for the bitwise AND operator).

Original entry on oeis.org

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

Views

Author

Paul Tek, Mar 05 2014

Keywords

Comments

This is a permutation of the positive integers.
Apparently, a self-inverse permutation.
There are no fixed points.

Crossrefs

Cf. A238758.

Programs

  • Perl
    See Link section.
    
  • Python
    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: an += 1
            aset.add(an); yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 64))) # Michael S. Branicky, Jun 22 2022

A352728 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of n and a(n) have exactly one common run of consecutive 1's.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
This sequence is a variant of A238758; here we consider runs of consecutive 1's, there individual 1's in binary expansions.
We only consider runs of consecutive 1's that completely match in binary expansions of n and a(n), not simply single common 1's.

Examples

			The first terms, alongside the corresponding runs of 1's in binary expansions, are:
  n   a(n)  runs in n  runs in a(n)
  --  ----  ---------  ------------
   1     1  [1]        [1]
   2     2  [2]        [2]
   3     3  [3]        [3]
   4     4  [4]        [4]
   5     9  [1, 4]     [1, 8]
   6     6  [6]        [6]
   7     7  [7]        [7]
   8     8  [8]        [8]
   9     5  [1, 8]     [1, 4]
  10    11  [2, 8]     [3, 8]
  11    10  [3, 8]     [2, 8]
  12    12  [12]       [12]
  13    17  [1, 12]    [1, 16]
  14    14  [14]       [14]
  15    15  [15]       [15]
  16    16  [16]       [16]
		

Crossrefs

Programs

  • PARI
    See Links section.

A370629 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, the Zeckendorf expansions of n and a(n) have exactly one common term.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 01 2024

Keywords

Comments

This sequence is a self-inverse permutation of the positive integers.
Fixed points correspond to positive Fibonacci numbers.

Examples

			The first terms, alongside the Zeckendorf expansion in binary of n and of a(n), are:
  n   a(n)  z(n)    z(a(n))
  --  ----  ------  -------
   1     1       1        1
   2     2      10       10
   3     3     100      100
   4     6     101     1001
   5     5    1000     1000
   6     4    1001      101
   7    10    1010    10010
   8     8   10000    10000
   9    11   10001    10100
  10     7   10010     1010
  11     9   10100    10001
  12    14   10101   100001
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

Formula

A000120(A003714(n), A003714(a(n))) = 1.

A354224 Lexicographically earliest sequence of distinct positive integers such that a(1) = 1 and for any n > 1, the greatest common divisor of n and a(n) is a prime number.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 20 2022

Keywords

Comments

This sequence is a self-inverse permutation of the positive integers.

Examples

			The first terms are:
  n   a(n)  gcd(n, a(n))
  --  ----  ------------
   1     1             1
   2     2             2
   3     3             3
   4     6             2
   5     5             5
   6     4             2
   7     7             7
   8    10             2
   9    12             3
  10     8             2
  11    11            11
  12     9             3
  13    13            13
  14    16             2
		

Crossrefs

Cf. A238758.

Programs

  • PARI
    s=0; for (n=1, 67, for (v=1, oo, if (!bittest(s,v) && (n==1 || isprime(gcd(n,v))), print1 (v", "); s+=2^v; break)))
    
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, mink = {1}, 2; yield 1
        for n in count(2):
            k = mink
            while k in aset or not isprime(gcd(n, k)): k += 1
            aset.add(k); yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, May 23 2022

Formula

a(n) = n iff n = 1 or n is a prime number.
Showing 1-4 of 4 results.