OFFSET
1,1
COMMENTS
Numbers whose binary representation contains the bit string "10" but not "01". Subsequence of A062289; set difference A062289 minus A101082. - Rick L. Shepherd, Nov 29 2004
Mersenne numbers (A000225) times powers of 2 (A000079). Therefore this sequence contains the even perfect numbers (A000396). - Alonso del Arte, Apr 21 2006
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
FORMULA
This sequence is twice A023758. - Franklin T. Adams-Watters, Apr 21 2006
Sum_{n>=1} 1/a(n) = A065442. - Amiram Eldar, Feb 20 2022
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 *)
Select[Range[2500], Length[Split[IntegerDigits[#, 2]]]==2&] (* or *) Select[Range[2500], SequenceCount[IntegerDigits[#, 2], {1, 0}]>0 && SequenceCount[ IntegerDigits[#, 2], {0, 1}]==0&] (* Harvey P. Dale, Oct 04 2024 *)
PROG
(Python)
def ok(n): b = bin(n)[2:]; return "10" in b and "01" not in b
print([m for m in range(2045) if ok(m)]) # Michael S. Branicky, Feb 04 2021
(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
More terms from Rick L. Shepherd, Nov 29 2004
STATUS
approved