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!)
A095018 a(n) is the number of primes p which have exactly n zeros and n ones when written in binary. 11
1, 0, 2, 4, 17, 28, 189, 531, 1990, 5747, 23902, 76658, 291478, 982793, 3677580, 13214719, 49161612, 177190667, 664806798, 2443387945 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
a(n) is the number of terms in A066196 which lie between 2^(2n-1) and 2^2n inclusively.
LINKS
EXAMPLE
a(1) = 1 since only 2_10 = 10_2 satisfies the criterion;
a(2) = 0 since there is no prime between 4 and 16 which meets the criterion.
The only primes in the range ]2^5,2^6[ with equal numbers of ones and zeros in their binary expansion are 37 (in binary 100101) and 41 (in binary 101011) thus a(3)=2.
a(4) = 4 since 139, 149, 163 and 197 meet the criterion; etc.
MATHEMATICA
f[n_] := Block[{c = 0, p = NextPrime[2^(2n -1) -1], lmt = 2^(2n)}, While[p < lmt, If[DigitCount[p, 2, 1] == n, c++]; p = NextPrime@ p]; c]; Array[f, 17] (* K. D. Bajpai and Robert G. Wilson v, Jan 10 2017 *)
CROSSREFS
Sequence in context: A318367 A317488 A103051 * A081356 A018269 A270359
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 01 2004
EXTENSIONS
Edited by N. J. A. Sloane, Jan 16 2017
a(18)-a(20) from Amiram Eldar, Nov 21 2020
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 11 04:10 EDT 2024. Contains 372388 sequences. (Running on oeis4.)