login
A333693
Inverse permutation to A333692.
3
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 25, 20, 21, 26, 29, 24, 19, 22, 23, 28, 27, 30, 31, 32, 33, 34, 49, 36, 41, 50, 57, 40, 37, 42, 45, 52, 53, 58, 61, 48, 35, 38, 39, 44, 43, 46, 55, 56, 51, 54, 47, 60, 59, 62, 63, 64, 65, 66, 97
OFFSET
0,3
FORMULA
a(2*n) = 2*a(n).
EXAMPLE
A333692(90) = 86, hence a(86) = 90.
PROG
(PARI) a(n, base=2) = { if (n==0, 0, n%base==0, base*a(n/base, base), my (r=fromdigits(Vecrev(digits(n, base)), base)); base*a(r\base, base)+(r%base)) }
CROSSREFS
Sequence in context: A332808 A108548 A333692 * A322464 A057889 A235027
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 04 2020
STATUS
approved