The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254378 Run lengths of A228495 (Characteristic function of the odd odious numbers). 3
1, 1, 5, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 5, 1, 3, 1, 1, 1, 3, 1, 5, 1, 1, 1, 5, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 5, 1, 1, 1, 5, 1, 3, 1, 1, 1, 3, 1, 5, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 5, 1, 3, 1, 1, 1, 3, 1, 5, 1, 1, 1, 5, 1, 3, 1, 1, 1, 3, 1, 5, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 5, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Also run lengths of A254377 = 1-A228495(n).
LINKS
EXAMPLE
A228495 begins 0,1,0,0,0,0,0,1,0, hence this sequence begins 1,1,5,1.
MATHEMATICA
Length /@ Split[Table[If[OddQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0], {n, 0, 200}]] (* Amiram Eldar, Aug 07 2023 *)
PROG
(PARI)
up_to = 65537;
A254378lista(up_to) = { my(v=vector(up_to), r=1, n=0, i=1, pb=0, b); while(n<up_to, b = (hammingweight(i)%2)*(i%2); if(b==pb, r++, n++; v[n] = r; r = 1; pb = b); i++); (v); }; \\ Antti Karttunen, Oct 01 2018
v254378 = A254378lista(up_to);
A254378(n) = v254378[n]; \\ Antti Karttunen, Oct 01 2018
(Python)
from itertools import count, islice, groupby
def A254378_gen(): # generator of terms
return (len(list(g)) for k, g in groupby(n.bit_count()&1&n for n in count(0)))
A254378_list = list(islice(A254378_gen(), 20)) # Chai Wah Wu, Mar 09 2023
CROSSREFS
Sequence in context: A091384 A011305 A348317 * A134568 A198798 A229181
KEYWORD
nonn,base
AUTHOR
Jeremy Gardiner, Jan 29 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 04:41 EDT 2024. Contains 372758 sequences. (Running on oeis4.)