OFFSET
1,1
COMMENTS
a(n) exists because if n has t bits, then (2^t+1)*n is a binary square.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..8191
EXAMPLE
a(5) = 2 because 5 is not a binary square, but 5*2 = 10 is (its binary representation is 1010).
MAPLE
a:= proc(n) local k; for k while not (s-> (l->
l::even and s[1..l/2]=s[l/2+1..l])(length(s)))(
convert(convert(k*n, binary), string)) do od; k
end:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 12 2018
PROG
(PARI) is(n) = my(L=#binary(n)\2); n>>L==bitand(n, 2^L-1); \\ A020330
a(n) = my(k=1); while (!is(k*n), k++); k; \\ Michel Marcus, Oct 12 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Oct 12 2018
STATUS
approved