login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = the number of digits in the binary representation of n that each either precede and/or follow a similarly valued digit.
2

%I #12 May 12 2024 00:47:20

%S 0,0,2,2,0,2,3,3,2,0,2,4,2,3,4,4,3,2,4,2,0,2,3,5,4,2,4,5,3,4,5,5,4,3,

%T 5,4,2,4,5,3,2,0,2,4,2,3,4,6,5,4,6,4,2,4,5,6,5,3,5,6,4,5,6,6,5,4,6,5,

%U 3,5,6,5,4,2,4,6,4,5,6,4,3,2,4,2,0,2,3,5,4,2,4,5,3,4,5,7,6,5,7,6,4,6,7,5,4

%N a(n) = the number of digits in the binary representation of n that each either precede and/or follow a similarly valued digit.

%H John Tyler Rascoe, <a href="/A165316/b165316.txt">Table of n, a(n) for n = 1..8191</a>

%e 184 in binary is 10111001. There are exactly five binary digits (the 2nd, 3rd, and 4th 1's from the left, and the 2nd and 3rd 0's from the left) that are each adjacent to a similar digit. So a(184) = 5.

%Y Cf. A165317.

%K base,nonn,easy

%O 1,3

%A _Leroy Quet_, Sep 14 2009

%E Extended by _Ray Chandler_, Mar 13 2010