|
|
A043569
|
|
Numbers whose base-2 representation has exactly 2 runs.
|
|
8
|
|
|
2, 4, 6, 8, 12, 14, 16, 24, 28, 30, 32, 48, 56, 60, 62, 64, 96, 112, 120, 124, 126, 128, 192, 224, 240, 248, 252, 254, 256, 384, 448, 480, 496, 504, 508, 510, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1024, 1536, 1792, 1920, 1984, 2016, 2032, 2040, 2044
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
a:=proc(n) local nn, nd: nn:=convert(n, base, 2): nd:={seq(nn[j]-nn[j-1], j=2..nops(nn))}: if n=2 then 2 elif nd={0, 1} then n else fi end: seq(a(n), n=1..2100); # Emeric Deutsch, Apr 21 2006
|
|
MATHEMATICA
|
Take[Sort[Flatten[Table[(2^x - 1)*(2^y), {x, 32}, {y, 32}]]], 54] (* Alonso del Arte, Apr 21 2006 *)
|
|
PROG
|
(Python)
def ok(n): b = bin(n)[2:]; return "10" in b and "01" not in b
(Python)
def a_next(a_n): t = a_n >> 1; return (a_n | t) + (t & 1)
a_n = 2; a = []
for i in range(54): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|