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