OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..9841
Rémy Sigrist, PARI program
EXAMPLE
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
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 16 2024
STATUS
approved