OFFSET
1,2
EXAMPLE
9 is 1001 in base 2; complement: 0110; reverse: 0110 that is 6 in base 10 and 9' = 6;
21 is 10101 in base 2; complement: 01010; reverse: 01010 that is 10 in base 10 and 21' = 10.
MAPLE
P:=proc(q) local a, b, k, n, p;
for n from 1 to q do a:=convert(n, base, 2); b:=0;
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;
if b=n*add(op(2, p)/op(1, p), p=ifactors(n)[2]) then print(n); fi;
od; end: P(10^6);
MATHEMATICA
f[n_] := If[Abs@ n < 2, 0, n Total[#2/#1 & @@@ FactorInteger@ Abs@ n]]; g[n_] := FromDigits[Reverse[IntegerDigits[n, 2] /. {1 -> 0, 0 -> 1}], 2]; Select[Range[10^6], f@ # == g@ # &] (* Michael De Vlieger, Mar 03 2016, after Michael Somos at A003415 and Harvey P. Dale at A036044 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Paolo P. Lava, Mar 02 2016
STATUS
approved