%I #12 Jan 10 2021 22:19:25
%S 0,1,3,2,5,4,6,7,13,12,14,15,8,9,11,10,21,20,22,23,16,17,19,18,24,25,
%T 27,26,29,28,30,31,55,54,52,53,50,51,49,48,58,59,57,56,63,62,60,61,34,
%U 35,33,32,39,38,36,37,47,46,44,45,42,43,41,40,89,88,90,91
%N For any number n >= 0 with binary expansion Sum_{k = 0..w} b(k)*2^k, a(n) = (b(0)*A340400(0)) XOR ... XOR (b(w)*A340400(w)) (where XOR denotes the bitwise XOR operator).
%C This sequence is a permutation of the nonnegative integers (with inverse A340478) that preserves the number of binary digits.
%H Rémy Sigrist, <a href="/A340402/b340402.txt">Table of n, a(n) for n = 0..8191</a>
%H Rémy Sigrist, <a href="/A340402/a340402.png">Scatterplot of the first 2^16 terms</a>
%H Rémy Sigrist, <a href="/A340402/a340402.gp.txt">PARI program for A340402</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e For n = 41:
%e - 41 = 2^5 + 2^3 + 2^0,
%e - so a(41) = A340400(5) XOR A340400(3) XOR A340400(0) = 55 XOR 13 XOR 1 = 59.
%o (PARI) See Links section.
%Y Cf. A340400, A340401, A340478 (inverse).
%K nonn,base
%O 0,3
%A _Rémy Sigrist_, Jan 06 2021