OFFSET
1,1
COMMENTS
This sequence is a self-inverse permutation of the positive integers with no fixed point.
We can build a similar tree from any sequence of positive integers where each value appears infinitely many times. The choice of A082850 is interesting as each parent node appears immediately after its second child; also, for each pair of nodes of the same level, say p and p', and each pair of nodes, c and c', where c has ancestor p and c' has ancestor p', and the relative position of p with respect to c is the same as for p' with respect to c', we have p - c = p' - c'.
LINKS
FORMULA
EXAMPLE
The perfect infinite binary tree starts as follows:
31
---------------------------------
15 30
----------------- -----------------
7 14 22 29
--------- --------- --------- ---------
3 6 10 13 18 21 25 28
----- ----- ----- ----- ----- ----- ----- -----
1 2 4 5 8 9 11 12 16 17 19 20 23 24 26 27
.
So a(1) = 2 and a(2) = 1, a(4) = 5 and a(5) = 4, etc.,
a(3) = 6 and a(6) = 3, a(10) = 13 and a(13) = 10, etc.,
a(7) = 14 and a(14) = 7, a(22) = 29 and a(29) = 22,
a(15) = 30 and a(30) = 15.
PROG
(PARI) a(n) = { my (n0 = n); for (h = 2, oo, if (n < 2^h-1, while (1, my (w=2^h-- - 1); if (n == w, return (n0 - n + 2*w), n == 2*w, return (n0 - n + w), n > w, n -= w)))) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 04 2023
STATUS
approved