OFFSET
0,3
COMMENTS
This sequence is a permutation of the nonnegative integers with inverse A365279.
For any pair (b, c) of bases >= 2, we can devise a similar sequence, say F_{b, c}:
- for any d >= 2, let Z_d be the set of zeroless numbers in base d,
- in the base b expansion of n replace each run of consecutive nonzero digits (say corresponding to Z_b(k) for some k > 0) by the base c digits of Z_c(k) to get the base c expansion of F_{b, c}(n),
- F_{b, c} is a permutation of the nonnegative integers with inverse F_{c, b},
- F_{c, d} o F_{b, c} = F_{b, d} and F_{b, b} is the identity,
- in particular the present sequence corresponds to F_{2, 3} and its inverse to F_{3, 2}.
LINKS
EXAMPLE
MATHEMATICA
A007931[n_]:=Rest[IntegerDigits[n+1, 2]]+1;
A365278[n_]:=FromDigits[Flatten[Map[If[First[#]==1, A007931[Length[#]], #]&, Split[IntegerDigits[n, 2]]]], 3];
Array[A365278, 100, 0] (* Paolo Xausa, Oct 17 2023 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 30 2023
STATUS
approved