login
A341055
Inverse permutation to A341054.
3
0, 1, 4, 2, 3, 12, 13, 11, 5, 6, 7, 10, 8, 9, 36, 37, 35, 38, 39, 40, 34, 32, 33, 15, 16, 14, 17, 18, 19, 22, 20, 21, 30, 31, 29, 23, 24, 25, 28, 26, 27, 108, 109, 107, 110, 111, 112, 106, 104, 105, 114, 115, 113, 116, 117, 118, 121, 119, 120, 102, 103, 101
OFFSET
0,3
COMMENTS
This sequence is similar to A003188.
EXAMPLE
A341054(42) = 76, so a(76) = 42.
PROG
(PARI) a(n) = { my (d=[], s=Mod(0, 3)); while (n, my (t=centerlift(Mod(n, 3))); n=(n-t)\3; d=concat(t, d)); for (k=1, #d, d[k] = centerlift(d[k]-s); s+=d[k]); fromdigits(d, 3) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 25 2021
STATUS
approved