OFFSET
0,3
LINKS
PROG
(MIT Scheme:)
(C) uint32_t a(uint32_t n) { return ((n & 0xcccccccc) << 2) | ((n & 0x33333330) >> 2) | (n & 3); } /* Falk Hüffner, Jan 23 2022 */
(PARI) f(n) = my(d=Vecrev(digits(n, 4))); if (#d % 2, d = concat(d, 0)); fromdigits(Vecrev(vector(#d, i, d[i+(-1)^(i-1)])), 4); \\ A126006
a(n) = (n % 4) + 4*f(n\4); \\ Michel Marcus, Jan 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jan 02 2007
STATUS
approved