login
A365278
In the binary expansion of n replace each run of k consecutive 1's by the decimal digits of A007931(k) to get the ternary expansion of a(n).
3
0, 1, 3, 2, 9, 10, 6, 4, 27, 28, 30, 11, 18, 19, 12, 5, 81, 82, 84, 29, 90, 91, 33, 31, 54, 55, 57, 20, 36, 37, 15, 7, 243, 244, 246, 83, 252, 253, 87, 85, 270, 271, 273, 92, 99, 100, 93, 32, 162, 163, 165, 56, 171, 172, 60, 58, 108, 109, 111, 38, 45, 46, 21
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}.
FORMULA
a(2*n) = 3*a(n).
a(2^k - 1) = A032924(k) for any k > 0.
A077267(a(n)) = A023416(n).
EXAMPLE
The binary expansion of 415 is "110011111", A007931(2) = 2 and A007931(5) = 21, so the ternary expansion of a(415) is "20021", and a(415) = 169.
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
Sequence in context: A244995 A152049 A246788 * A342802 A099887 A366348
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 30 2023
STATUS
approved