login
A302843
Permutation of nonnegative integers: a(n) = A163355(A006068(n)).
5
0, 1, 2, 3, 12, 13, 14, 15, 10, 9, 8, 11, 4, 7, 6, 5, 26, 27, 24, 25, 30, 29, 28, 31, 16, 19, 18, 17, 22, 23, 20, 21, 42, 43, 40, 41, 46, 45, 44, 47, 32, 35, 34, 33, 38, 39, 36, 37, 58, 57, 56, 59, 52, 55, 54, 53, 48, 49, 50, 51, 60, 61, 62, 63, 192, 193, 194, 195, 204, 205, 206, 207, 202, 201, 200, 203, 196, 199, 198, 197, 218, 219, 216, 217, 222
OFFSET
0,3
FORMULA
a(n) = A163355(A006068(n)).
a(n) = A302845(A003188(n)).
PROG
(PARI)
A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
A057300(n) = { my(t=1, s=0); while(n>0, if(1==(n%4), n++, if(2==(n%4), n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
A163355(n) = if(!n, n, my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d, f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r))));
CROSSREFS
Cf. A302844 (inverse).
Sequence in context: A266366 A201501 A370548 * A037321 A227745 A255567
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 14 2018
STATUS
approved