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!)
A340466 Primes whose binary expansion contains more 1's than 0's but at least one 0. 0
5, 11, 13, 19, 23, 29, 43, 47, 53, 59, 61, 71, 79, 83, 89, 101, 103, 107, 109, 113, 151, 157, 167, 173, 179, 181, 191, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 283, 307, 311, 313, 317, 331, 347, 349, 359, 367, 373, 379, 383, 397, 409, 419, 421, 431 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
{ A095070 } minus { A000225 }.
{ A095070 } minus { A000668 }.
{ A095070 } intersect { A138837 }.
EXAMPLE
71 is in the sequence because 71 is a prime and 71_10 = 1000111_2. '1000111' has four 1's and three 0's.
MATHEMATICA
Select[Range[400], PrimeQ[#] && First[d = DigitCount[#, 2]] > Last[d] > 0 &] (* Amiram Eldar, Jan 08 2021 *)
PROG
(PARI) isok(n) = if (isprime(n), my(nb=#binary(n), h=hammingweight(n)); (2*h > nb) && (h < nb)); \\ Michel Marcus, Jan 10 2021
(Python)
from sympy import sieve
A340466_list = [p for p in sieve.primerange(1, 10**4) if len(bin(p))-2 < 2*bin(p).count('1') < 2*len(bin(p))-4] # Chai Wah Wu, Jan 10 2021
CROSSREFS
Sequence in context: A153418 A079019 A191034 * A222219 A023225 A206581
KEYWORD
nonn,base,easy
AUTHOR
Ctibor O. Zizka, Jan 08 2021
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 1 17:11 EDT 2024. Contains 372175 sequences. (Running on oeis4.)