

A329101


Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the number of 1's in the base 4 expansion of n equals the number of 2's in the base 4 expansion of a(n).


2



0, 2, 1, 3, 6, 10, 8, 9, 4, 11, 5, 7, 12, 14, 13, 15, 18, 26, 22, 24, 34, 42, 38, 40, 25, 41, 27, 30, 32, 43, 33, 35, 16, 36, 17, 19, 37, 46, 39, 44, 20, 45, 21, 23, 28, 47, 29, 31, 48, 50, 49, 51, 54, 58, 56, 57, 52, 59, 53, 55, 60, 62, 61, 63, 66, 74, 70, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

This sequence is a permutation of the nonnegative integers with inverse A329180.
Apparently, fixed points correspond to A001196.
The sequence has fractal features; for any k >= 0, the set of points { (n, a(n)), n = 0..4^k1 } is symmetrical relative to the line of equation y + x = 4^k  1 (see scatterplots in Links section).


LINKS



FORMULA



EXAMPLE

The first terms, alongside the base 4 representations of n and of a(n), are:
n a(n) qua(n) qua(a(n))
   
0 0 0 0
1 2 1 2
2 1 2 1
3 3 3 3
4 6 10 12
5 10 11 22
6 8 12 20
7 9 13 21
8 4 20 10
9 11 21 23
10 5 22 11
11 7 23 13
12 12 30 30
13 14 31 32
14 13 32 31
15 15 33 33


PROG

(PARI) See Links section.


CROSSREFS



KEYWORD

nonn,base


AUTHOR



STATUS

approved



