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

A342102 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, {A000120(n), A080791(n)} = {A000120(a(n)), A080791(a(n))}.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 28 2021

Keywords

Comments

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

Examples

			The first terms, in decimal and in binary, alongside {A000120(n), A080791(n)}, are:
  n   a(n)  bin(n)  bin(a(n))  {A000120(n), A080791(n)}
  --  ----  ------  ---------  ------------------------
   0     0       0          0  {0}
   1     1       1          1  {0, 1}
   2     2      10         10  {1}
   3     3      11         11  {0, 2}
   4     6     100        110  {1, 2}
   5     5     101        101  {1, 2}
   6     4     110        100  {1, 2}
   7     7     111        111  {0, 3}
   8    14    1000       1110  {1, 3}
   9    12    1001       1100  {2}
  10    10    1010       1010  {2}
  11    13    1011       1101  {1, 3}
  12     9    1100       1001  {2}
  13    11    1101       1011  {1, 3}
  14     8    1110       1000  {1, 3}
  15    15    1111       1111  {0, 4}
		

Crossrefs

See A342115, A342116 and A342117 for similar sequences.

Programs

  • PARI
    \\ See Links section.

Formula

a(2^k-1) = 2^k-1 for any k >= 0.
a(n) < 2^k for any n < 2^k.

A337304 a(n) is the greatest number m not yet in the sequence such that the binary expansions of n and of m have the same runs of consecutive equal digits (up to order but with multiplicity).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 22 2020

Keywords

Comments

This sequence has similarities with A337242; here we consider runs, there run lengths.
This sequence is a self-inverse permutation of the nonnegative integers.
This sequence preserves the Hamming weight (A000120), the number of binary digits (A070939) and the number of runs in binary expansions (A005811).

Examples

			For n = 303:
- the binary expansion of 43 is "100101111",
- the corresponding runs of consecutive equals digits are "1", "00", "1", "0", "1111",
- there are six numbers k with the same multiset of runs:
    k    bin(k)
    ---  -----------
    303  "100101111"
    317  "100111101"
    335  "101001111"
    377  "101111001"
    485  "111100101"
    489  "111101001"
- so a(303) = 489,
     a(317) = 485,
     a(335) = 377,
     a(377) = 335,
     a(485) = 317,
     a(489) = 303.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2^k) = 2^k for any k >= 0.
a(2^k-1) = 2^k-1 for any k >= 0.

A371343 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of n and of a(n) have the same length (A070939) and the same number of runs of consecutive equals digits (A005811).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers with infinitely many fixed points (for example, all terms of A000225 are fixed points).

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     6     100        110
   5     5     101        101
   6     4     110        100
   7     7     111        111
   8    14    1000       1110
   9    13    1001       1101
  10    10    1010       1010
  11    11    1011       1011
  12    12    1100       1100
  13     9    1101       1001
  14     8    1110       1000
  15    15    1111       1111
		

Crossrefs

See A331274 and A337242 for similar sequences.

Programs

  • PARI
    \\ See Links section.
Showing 1-3 of 3 results.