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.

A379657 The nonadjacent form of a(n) is obtained by inserting a digit 0 before each nonzero digit in the balanced ternary expansion of n.

Original entry on oeis.org

0, 1, 3, 2, 5, 11, 6, 13, 7, 4, 9, 19, 10, 21, 43, 22, 45, 23, 12, 25, 51, 26, 53, 27, 14, 29, 15, 8, 17, 35, 18, 37, 75, 38, 77, 39, 20, 41, 83, 42, 85, 171, 86, 173, 87, 44, 89, 179, 90, 181, 91, 46, 93, 47, 24, 49, 99, 50, 101, 203, 102, 205, 103, 52, 105
Offset: 0

Views

Author

Rémy Sigrist, Dec 29 2024

Keywords

Comments

A permutation of the nonnegative integers with inverse A379658.

Examples

			The first terms are:  n   a(n)  bter(n)  naf(a(n))
  --  ----  -------  ---------
   0     0        0          0
   1     1        1          1
   2     3       1T        10T
   3     2       10         10
   4     5       11        101
   5    11      1TT      10T0T
   6     6      1T0       10T0
   7    13      1T1      10T01
   8     7      10T       100T
   9     4      100        100
  10     9      101       1001
  11    19      11T      1010T
  12    10      110       1010
		

Crossrefs

See A048680 for a similar sequence.
Cf. A065363, A334913, A379658 (inverse).

Programs

  • PARI
    a(n) = { my (v = 0, d, b = 1); while (n, d = centerlift(Mod(n, 3)); n = (n-d)/3;
     v += d * b; b *= if (d, 4, 2);); v; }

Formula

A334913(a(n)) = A065363(n).