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.

A371267 Lexicographically latest sequence of distinct nonnegative integers such that the run lengths transforms of the balanced ternary expansions of n and of a(n) are the same.

Original entry on oeis.org

0, 1, 3, 2, 4, 9, 10, 8, 7, 5, 6, 12, 11, 13, 27, 28, 26, 30, 31, 29, 25, 24, 23, 22, 21, 20, 16, 14, 15, 19, 17, 18, 36, 37, 35, 34, 32, 33, 39, 38, 40, 81, 82, 80, 84, 85, 83, 79, 78, 77, 90, 91, 89, 93, 94, 92, 88, 87, 86, 76, 75, 74, 73, 72, 71, 70, 69, 68
Offset: 0

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

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

Examples

			The first terms, in decimal and in balanced ternary, are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     3       1T          10
   3     2       10          1T
   4     4       11          11
   5     9      1TT         100
   6    10      1T0         101
   7     8      1T1         10T
   8     7      10T         1T1
   9     5      100         1TT
  10     6      101         1T0
  11    12      11T         110
  12    11      110         11T
  13    13      111         111
  14    27     1TTT        1000
  15    28     1TT0        1001
		

Crossrefs

See A371261 for a similar sequence.
Cf. A003462 (fixed points), A371263.

Programs

  • PARI
    \\ See Links section.

Formula

A371263(a(n)) = A371263(n).
a(n) = n iff n belongs to A003462.