A268477 Balanced odious primes: primes with an odd number of runs of 1's in their binary expansion.
2, 3, 7, 31, 37, 41, 43, 53, 73, 83, 89, 101, 107, 109, 127, 137, 139, 151, 157, 163, 167, 179, 197, 211, 229, 233, 269, 281, 283, 307, 311, 313, 317, 353, 359, 367, 379, 389, 397, 401, 409, 419, 431, 433, 439, 443, 457, 461, 467, 491, 521, 523, 541, 547, 563
Offset: 1
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
- Vladimir Shevelev, Two analogs of Thue-Morse sequence, arXiv:1603.04434 [math.NT], 2016.
Programs
-
Mathematica
Select[Prime@ Range@ 108, OddQ@ Length[Split@ IntegerDigits[#, 2] /. {0, _} -> Nothing] &] (* Michael De Vlieger, Feb 08 2016 *)
-
Python
from sympy import prime A268477_list = [p for p in (prime(i) for i in range(1,10**6)) if len(list(filter(bool,format(p,'b').split('0')))) % 2] # Chai Wah Wu, Mar 01 2016
Extensions
More terms from Peter J. C. Moses, Feb 05 2016
Comments