login
Balanced odious numbers: numbers with an odd number of runs of 1's in their binary expansion.
7

%I #45 Nov 16 2024 21:30:18

%S 1,2,3,4,6,7,8,12,14,15,16,21,24,28,30,31,32,37,41,42,43,45,48,53,56,

%T 60,62,63,64,69,73,74,75,77,81,82,83,84,86,87,89,90,91,93,96,101,105,

%U 106,107,109,112,117,120,124,126,127,128,133,137,138,139,141

%N Balanced odious numbers: numbers with an odd number of runs of 1's in their binary expansion.

%C In the balanced binary system the sequence A268411 plays the role of the Thue-Morse sequence (A010060). Therefore we call the balanced odious numbers those numbers n for which A268411(n) = 1.

%C Complement of A268412.

%H Peter J. C. Moses (terms 1..1000) & Antti Karttunen, <a href="/A268415/b268415.txt">Table of n, a(n) for n = 1..8129</a>

%H Vladimir Shevelev, <a href="http://arxiv.org/abs/1603.04434">Two analogs of Thue-Morse sequence</a>, arXiv:1603.04434 [math.NT], 2016.

%F Other identities. For all n >= 1:

%F A268382(a(n)) = n.

%e 77 is a member because its binary expansion (1001101) has 3 runs of 1's, and 3 is odd.

%t balancedBinary:=Join[#,{0}]-Join[{0},#]&[IntegerDigits[#,2]]&;

%t Flatten[Position[Map[Mod[Count[balancedBinary[#],1],2]&,Range[0,100]],1]-1] (* _Peter J. C. Moses_, Feb 04 2016 *)

%t Select[Range[200],OddQ[Count[Split[IntegerDigits[#,2]],_?(MemberQ[ #,1]&)]]&] (* _Harvey P. Dale_, Mar 31 2019 *)

%o (Scheme) (define A268415 (ZERO-POS 1 1 (COMPOSE -1+ A268411))) ;; requires also my IntSeq-library. - _Antti Karttunen_, Feb 05 2016

%o (Python)

%o A268415_list = [i for i in range(10**6) if len(list(filter(bool,format(i,'b').split('0')))) % 2] # _Chai Wah Wu_, Mar 01 2016

%Y Positions of odd terms in A069010.

%Y Cf. A010060, A000069, A268411.

%Y Cf. A268412 (complement).

%Y Cf. A268382 (the least monotonic left inverse).

%Y Cf. A268477 (primes in this sequence).

%K nonn,base

%O 1,2

%A _Vladimir Shevelev_, Feb 04 2016

%E More terms from _Peter J. C. Moses_, Feb 04 2016