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

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

Original entry on oeis.org

0, 1, 3, 2, 9, 4, 6, 8, 27, 10, 12, 5, 18, 7, 24, 26, 81, 28, 30, 11, 36, 13, 15, 17, 54, 19, 21, 23, 72, 25, 78, 80, 243, 82, 84, 29, 90, 31, 33, 35, 108, 37, 39, 14, 45, 16, 51, 53, 162, 55, 57, 20, 63, 22, 69, 71, 216, 73, 75, 77, 234, 79, 240, 242, 729
Offset: 0

Views

Author

Rémy Sigrist, Dec 29 2024

Keywords

Comments

A permutation of the nonnegative integers with inverse A379657.

Examples

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

Crossrefs

See A048679 for a similar sequence.
Cf. A065363, A334913, A379657 (inverse).

Programs

  • PARI
    a(n) = { my (v = 0, t = 1, d); while (n, if (n%2, n -= d = 2 - (n%4); v += d*t; t /= 3;); n \= 2; t *= 3;); return (v); }

Formula

A065363(a(n)) = A334913(n).
Showing 1-1 of 1 results.