|
|
A161399
|
|
a(n) = the smallest divisor of n that contains the same number of (non-leading) 0's as n when both numbers are written in binary.
|
|
2
|
|
|
1, 2, 1, 4, 5, 2, 1, 8, 9, 10, 11, 4, 13, 2, 1, 16, 17, 18, 19, 20, 21, 22, 23, 8, 25, 26, 27, 4, 29, 2, 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 9, 46, 47, 16, 49, 50, 51, 52, 53, 9, 5, 8, 19, 58, 59, 4, 61, 2, 1, 64, 65, 66, 67, 68, 69, 70, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
MAPLE
|
with(numtheory):
z:= proc(n) local m, r; m, r:=n, 0;
while m>1 do r:= r+1-irem(m, 2, 'm'); r od
end:
a:= proc(n) local d, t; t:=z(n);
for d in sort([divisors(n)[]]) do
if z(d)=t then return d fi od
end:
|
|
MATHEMATICA
|
sdn[n_]:=SelectFirst[Divisors[n], DigitCount[#, 2, 0]==DigitCount[n, 2, 0]&]; Array[sdn, 80] (* The program uses the SelectFirst function from Mathematica version 10 *) (* Harvey P. Dale, Sep 05 2015 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|