login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = n XOR floor(Log_2(n))+1, where XOR is bitwise XOR.
0

%I #2 Mar 30 2012 17:31:29

%S 0,1,7,6,5,4,12,13,14,15,8,9,10,11,21,20,23,22,17,16,19,18,29,28,31,

%T 30,25,24,27,26,38,39,36,37,34,35,32,33,46,47,44,45,42,43,40,41,54,55,

%U 52,53,50,51,48,49,62,63,60,61,58,59,56,57,71,70,69,68,67,66,65,64,79,78

%N a(n) = n XOR floor(Log_2(n))+1, where XOR is bitwise XOR.

%C Except for 2 & 3 which are missing, is every integer present just once?

%t f[n_] := BitXor[n, Floor[Log[2, n] + 1]]; t = Array[f, 75, 2];

%K easy,nonn

%O 2,3

%A _Robert G. Wilson v_, Jun 09 2010