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

A332022 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n and a(n) have no common term in their Zeckendorf representations.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 23 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
Apparently, {a(0), ..., a(k)} = {0, ..., k} for infinitely many integers k.

Examples

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

Crossrefs

Cf. A003714, A238757 (binary analog), A332565.

Programs

  • PARI
    See Links section.

Formula

A003714(n) AND A003714(a(n)) = 0 for any n >= 0 (where AND denotes the bitwise AND operator).

A238758 Lexicographically earliest sequence of distinct positive integers such that a(n) AND n is a power of 2 for any n>0 (AND stands for the bitwise AND operator).

Original entry on oeis.org

1, 2, 5, 4, 3, 10, 9, 8, 7, 6, 12, 11, 17, 18, 20, 16, 13, 14, 24, 15, 26, 25, 33, 19, 22, 21, 34, 36, 35, 37, 40, 32, 23, 27, 29, 28, 30, 41, 48, 31, 38, 49, 52, 50, 65, 66, 68, 39, 42, 44, 69, 43, 67, 74, 73, 72, 71, 70, 76, 75, 80, 81
Offset: 1

Views

Author

Paul Tek, Mar 05 2014

Keywords

Comments

This is a permutation of the positive integers.
Apparently, a self-inverse permutation.
The powers of 2 (A000079) are the fixed points.

Crossrefs

Cf. A238757.

Programs

  • Mathematica
    s = {}; Do[j=1; While[ MemberQ[s,j] || (b = BitAnd[j, n]) == 0 || BitAnd[b, b-1] > 0, j++]; AppendTo[s, j], {n, 62}]; s (* Giovanni Resta, Mar 05 2014 *)
  • Perl
    See Link section.

A359806 Lexicographically earliest sequence of distinct positive terms such that for any n > 0 and any k > 0, floor((2^k) / n) AND floor((2^k) / a(n)) = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

2, 1, 6, 5, 4, 3, 14, 9, 8, 40, 32, 24, 60, 7, 20, 17, 16, 144, 128, 15, 72, 64, 512, 12, 256, 120, 13824, 39, 2048, 35, 62, 11, 1056, 544, 30, 288, 4096, 1008, 28, 10, 1024, 156, 5504, 1408, 112, 1424, 8192, 96, 1016, 51200, 102, 240, 32768, 27648, 248, 78
Offset: 1

Views

Author

Rémy Sigrist, Jan 13 2023

Keywords

Comments

In other words, for any n > 0, the binary expansions of 1/n and of 1/a(n) have no common one bit; in this sense, this sequence is similar to A238757.
This sequence is a self-inverse permutation of the positive integers.

Examples

			The first terms, alongside the binary expansions of 1/n and 1/a(n) (with periodic parts in parentheses), are:
  n   a(n)  bin(1/n)        bin(1/a(n))
  --  ----  --------------  -----------
   1     2  1.(0)           0.1(0)
   2     1  0.1(0)          1.(0)
   3     6  0.(01)          0.0(01)
   4     5  0.01(0)         0.(0011)
   5     4  0.(0011)        0.01(0)
   6     3  0.0(01)         0.(01)
   7    14  0.(001)         0.0(001)
   8     9  0.001(0)        0.(000111)
   9     8  0.(000111)      0.001(0)
  10    40  0.0(0011)       0.000(0011)
  11    32  0.(0001011101)  0.00001(0)
  12    24  0.00(01)        0.000(01)
		

Crossrefs

See A306231 for a similar sequence.
Cf. A238757.

Programs

  • PARI
    See Links section.

A262155 Lexicographically earliest sequence of distinct positive integers such that for any n>0, n and a(n) have no common 1-bit in their binary representations, and no two successive terms have a common 1-bit in their binary representations.

Original entry on oeis.org

2, 1, 4, 3, 8, 16, 32, 5, 18, 33, 20, 34, 64, 17, 96, 6, 40, 65, 12, 35, 72, 128, 104, 7, 160, 68, 256, 66, 288, 129, 320, 9, 22, 73, 132, 10, 80, 136, 272, 67, 144, 69, 384, 19, 192, 257, 208, 11, 196, 264, 512, 74, 640, 265, 576, 130, 260, 193, 516, 131, 768
Offset: 1

Views

Author

Paul Tek, Sep 13 2015

Keywords

Comments

This sequence combines the constraints met in A109812 and in A238757.
This sequence is a permutation of the positive integers, with inverse A262230.

Examples

			For n=5:
- the values 2, 1, 4 and 3 have already been used;
- we have the following candidates:
+---+--------+-------------+---------------+
| z | Binary | Common bits |  Common bits  |
|   | digits |   with 5    | with a(5-1)=3 |
+---+--------+-------------+---------------+
| 5 |    101 |         101 |             1 |
| 6 |    110 |         100 |            10 |
| 7 |    111 |         101 |            11 |
| 8 |   1000 |           0 |             0 |
|...|    ... |         ... |           ... |
+---+--------+-------------+---------------+
Hence, a(5)=8.
		

Crossrefs

Programs

  • Perl
    See Links section.

A330984 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n and a(n) have no common 1 in their base phi representations.

Original entry on oeis.org

0, 2, 1, 5, 6, 3, 4, 12, 13, 14, 16, 17, 7, 8, 9, 34, 10, 11, 30, 31, 32, 35, 36, 33, 37, 41, 42, 43, 45, 46, 18, 19, 20, 23, 15, 21, 22, 24, 88, 89, 92, 25, 26, 27, 81, 28, 29, 77, 78, 79, 82, 83, 80, 84, 90, 93, 91, 94, 106, 85, 86, 95, 96, 87, 97, 107, 108
Offset: 0

Views

Author

Rémy Sigrist, Apr 23 2020

Keywords

Comments

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

Examples

			The first terms, alongside the base phi representations of n and of a(n), are:
  n   a(n)  phi(n)      phi(a(n))
  --  ----  ----------  -------------
   0     0      0            0
   1     2      1           10.01
   2     1     10.01         1
   3     5    100.01      1000.1001
   4     6    101.01      1010.0001
   5     3   1000.1001     100.01
   6     4   1010.0001     101.01
   7    12  10000.0001  100000.101001
   8    13  10001.0001  100010.001001
   9    14  10010.0101  100100.001001
  10    16  10100.0101  101000.100001
		

Crossrefs

Cf. A238757 (binary analog), A331212.

Programs

  • PARI
    See Links section.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
This sequence has similarities with A238757; here we consider runs of consecutive 1's, there individual 1's in binary expansions.
The binary expansion of n and a(n) may share some 1's, but cannot have a common run of consecutive 1's (as given by A352724).

Examples

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

Crossrefs

Programs

  • PARI
    See Links section.

A353648 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n and a(n) can be added without carries in balanced ternary.

Original entry on oeis.org

0, 2, 1, 5, 6, 3, 4, 17, 15, 14, 18, 16, 19, 23, 9, 8, 11, 7, 10, 12, 51, 50, 53, 13, 44, 45, 42, 41, 47, 43, 46, 54, 48, 49, 56, 52, 55, 57, 69, 68, 71, 27, 26, 29, 24, 25, 30, 28, 32, 33, 21, 20, 35, 22, 31, 36, 34, 37, 149, 153, 152, 155, 150, 151, 156, 154
Offset: 0

Views

Author

Rémy Sigrist, May 01 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence is a self-inverse permutation of the nonnegative integers with a single fixed point: a(0) = 0.

Examples

			The first terms, in decimal and in balanced ternary, are:
  n         |  0   1   2    3    4    5    6     7     8     9    10    11    12
  a(n)      |  0   2   1    5    6    3    4    17    15    14    18    16    19
  bter(n)   |  0   1  1T   10   11  1TT  1T0   1T1   10T   100   101   11T   110
  bter(a(n))|  0  1T   1  1TT  1T0   10   11  1T0T  1TT0  1TTT  1T00  1TT1  1T01
		

Crossrefs

Cf. A059095, A238757 (binary analog), A353649.

Programs

  • PARI
    ok(u, v) = { while (u && v, my (uu=[0, +1, -1][1+u%3], vv=[0, +1, -1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); 1 }
    { s=0; for (n=0, 65, for (v=0, oo, if (!bittest(s,v) && ok(n,v), print1 (v", "); s+=2^v; break))) }

A336193 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, n + a(n) can be computed without carry in base 10.

Original entry on oeis.org

1, 2, 3, 4, 10, 11, 12, 20, 30, 5, 6, 7, 13, 14, 21, 22, 31, 40, 50, 8, 15, 16, 23, 24, 32, 33, 41, 51, 60, 9, 17, 25, 26, 34, 42, 43, 52, 61, 100, 18, 27, 35, 36, 44, 53, 101, 102, 110, 120, 19, 28, 37, 45, 103, 104, 111, 112, 121, 130, 29, 38, 105, 106, 113
Offset: 1

Views

Author

Rémy Sigrist, Jul 11 2020

Keywords

Comments

This sequence is a decimal variant of A238757.
This sequence is a self-inverse permutation of the natural numbers.

Examples

			The first terms, alongside n + a(n), are:
  n   a(n)  n+a(n)
  --  ----  ------
   1     1       2
   2     2       4
   3     3       6
   4     4       8
   5    10      15
   6    11      17
   7    12      19
   8    20      28
   9    30      39
  10     5      15
  11     6      17
  12     7      19
  13    13      26
  14    14      28
  15    21      36
		

Crossrefs

Programs

  • PARI
    s=0; for (n=1, 64, for (v=1, oo, if (!bittest(s,v) && sumdigits(n+v)==sumdigits(n)+sumdigits(v), print1(v", "); s+=2^v; break)))

Formula

A007953(n + a(n)) = A007953(n) + A007953(a(n)).

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
Showing 1-9 of 9 results.