|
|
A165415
|
|
a(n) = the smallest positive integer that contains more digits written in binary than n has written in binary, and which does not contain binary n as a substring in its binary representation.
|
|
0
|
|
|
7, 4, 10, 8, 8, 8, 18, 16, 16, 16, 16, 16, 16, 16, 34, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 66, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 130, 128, 128, 128, 128, 128, 128
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
LINKS
|
|
|
FORMULA
|
a(2) = 7. For n >=2: a(2^n) = 2^(n+1) + 2; for m such that 2^(n-1)+1 <= m <= 2^n-1, a(m) = 2^n.
|
|
PROG
|
(Python)
def a(n):
if n == 2: return 7
digs = n.bit_length()
return int(2**digs) if n != 2**(digs - 1) else int(2**digs + 2)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|