%I #17 Aug 07 2023 02:12:19
%S 2,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,1,
%T 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,
%U 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
%N Run lengths of A254379 (Characteristic function of the even odious numbers).
%C Also run lengths of A254651 (complement of A254379).
%H Antti Karttunen, <a href="/A254655/b254655.txt">Table of n, a(n) for n = 1..65537</a>
%e A254379 begins 0,0,1,0,1,0,0,0,1, hence this sequence begins 2,1,1,1,3,1.
%t Length /@ Split[Table[If[EvenQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0], {n, 0, 200}]] (* _Amiram Eldar_, Aug 07 2023 *)
%o (PARI)
%o up_to = 65537;
%o A254655lista(up_to) = { my(v=vector(up_to), r=0, n=0, i=0, pb=(hammingweight(i)%2)*!(i%2), 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
%o v254655 = A254655lista(up_to);
%o A254655(n) = v254655[n]; \\ _Antti Karttunen_, Oct 01 2018
%o (Python)
%o from itertools import count, islice, groupby
%o def A254655_gen(): # generator of terms
%o return (len(list(g)) for k, g in groupby((n&1^1)&n.bit_count() for n in count(0)))
%o A254655_list = list(islice(A254655_gen(),20)) # _Chai Wah Wu_, Mar 09 2023
%Y Cf. A254378, A254379, A254651.
%K nonn,base
%O 1,1
%A _Jeremy Gardiner_, Feb 04 2015
%E More terms from _Antti Karttunen_, Oct 01 2018