login
A348556
Binary expansion contains 4 adjacent 1's.
1
15, 30, 31, 47, 60, 61, 62, 63, 79, 94, 95, 111, 120, 121, 122, 123, 124, 125, 126, 127, 143, 158, 159, 175, 188, 189, 190, 191, 207, 222, 223, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 271, 286, 287, 303, 316, 317, 318
OFFSET
1,1
COMMENTS
For k > 0, each term m = 2^(k+3) - 1 is the end of a run of A083593(k-1) consecutive terms. For k = 4, from a(13) = 120 up to a(20) = 2^7-1 = 127, there are A083593(3) = 8 consecutive terms corresponding to 1111000, 1111001, 1111010, 1111011, 1111100, 1111101, 111110 and 1111111. - Bernard Schott, Feb 20 2022
FORMULA
a(n) ~ n.
a(n+1) <= a(n) + 16.
MAPLE
q:= n-> verify([1$4], Bits[Split](n), 'sublist'):
select(q, [$0..400])[]; # Alois P. Heinz, Oct 22 2021
MATHEMATICA
Select[Range[300], StringContainsQ[IntegerString[#, 2], "1111"] &] (* Amiram Eldar, Oct 22 2021 *)
PROG
(PARI) is(n)=n=bitand(n, n<<2); !!bitand(n, n<<1);
(Python)
def ok(n): return "1111" in bin(n)
print([k for k in range(319) if ok(k)]) # Michael S. Branicky, Oct 22 2021
CROSSREFS
Binary expansion contains k adjacent 1s: A000027 (1), A004780 (2), A004781 (3), this sequence (4).
Subsequences: A110286, A195744.
Sequence in context: A297285 A115776 A095783 * A067400 A115801 A343343
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved