login
Numbers x such that BCR(x) = R(x), where BCR = binary-complement-and-reverse = take one's complement then reverse bit order and R(x) is the digits reverse of n.
0

%I #19 Dec 23 2016 21:24:01

%S 2,61,212,232,666,868,2222,642246,687588,820491,885786,2283822,

%T 2459542,2807082,2860682,45377354,214878412,841191148,841740971,

%U 49126162194

%N Numbers x such that BCR(x) = R(x), where BCR = binary-complement-and-reverse = take one's complement then reverse bit order and R(x) is the digits reverse of n.

%e 687588 in base 2 is 10100111110111100100. Its binary-complement-and-reverse is 11011000010000011010, which is 885786 in base 10.

%p with(numtheory): T:=proc(w) local x, y, z; x:=w; y:=0;

%p for z from 1 to ilog10(x)+1 do y:=10*y+(x mod 10); x:=trunc(x/10); od; y; end:

%p P:=proc(q) local a,b, k,n; for n from 1 to q do a:=convert(n,base,2); b:=0;

%p for k from 1 to nops(a) do if a[k]=0 then a[k]:=1 else a[k]:=0; fi; b:=2*b+a[k]; od;

%p if b=n then print(n); fi; od; end: P(10^6);

%t Select[Range[10^6], MatchQ @@ {FromDigits[#, 2] &@ Reverse[ IntegerDigits[#, 2] /. {0 -> 1, 1 -> 0}], FromDigits@ Reverse@ IntegerDigits@ #} &] (* _Michael De Vlieger_, Dec 16 2016 *)

%Y Cf. A004086, A035928, A036044.

%K nonn,base,more

%O 1,1

%A _Paolo P. Lava_, Dec 16 2016

%E a(17)-a(20) from _Hans Havermann_, Dec 23 2016