%I #15 Oct 22 2023 16:44:40
%S 0,1,2,3,4,5,6,7,8,9,10,26,12,22,14,15,16,17,18,25,20,21,13,29,24,19,
%T 11,27,28,23,30,31,32,33,34,98,36,82,50,57,40,74,42,106,104,45,58,122,
%U 48,70,38,51,88,86,54,118,56,39,46,110,60,94,62,63,64,65,66,97,68,81,49,113,72,73,41,105,100,89,114,121
%N Variant of bijective bit-reverse of n (A057889) for which it holds that a(n) == n (mod 3).
%C Like A057889, also this is a self-inverse permutation of nonnegative integers.
%H Antti Karttunen, <a href="/A366389/b366389.txt">Table of n, a(n) for n = 0..16383</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F If A057889(n) == n mod 3, then a(n) = A057889(n), otherwise a(n) = A073675(A057889(n)) = A057889(A073675(n)).
%F For all n >= 0, A010872(a(n)) = A010872(n).
%o (PARI)
%o A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2));
%o A057889(n) = if(!n,n,A030101(n/(2^valuation(n,2))) * (2^valuation(n, 2)));
%o A073675(n) = if(valuation(n,2)%2,n/2,2*n);
%o A366389(n) = { my(u=A057889(n)); if(!((u-n)%3),u,A073675(u)); };
%Y Cf. A010872, A030101, A057889, A073675, A366378, A366379, A366390 (Dirichlet inverse), A366392.
%Y Cf. also A118967.
%K nonn,look
%O 0,3
%A _Antti Karttunen_, Oct 22 2023