login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A372538
Numbers k such that the number of ones minus the number of zeros in the binary expansion of the k-th prime number is 1.
3
3, 8, 20, 23, 24, 26, 30, 58, 61, 63, 65, 67, 78, 80, 81, 82, 84, 88, 185, 187, 194, 200, 201, 203, 213, 214, 215, 221, 225, 226, 227, 234, 237, 246, 249, 253, 255, 256, 257, 259, 266, 270, 280, 284, 287, 290, 573, 578, 586, 588, 591, 593, 611, 614, 615, 626
OFFSET
1,1
EXAMPLE
The binary expansion of 83 is (1,0,1,0,0,1,1) with ones minus zeros 4 - 3 = 1, and 83 is the 23rd prime, so 23 is in the sequence.
The primes A000040(a(n)) together with their binary expansions and binary indices begin:
5: 101 ~ {1,3}
19: 10011 ~ {1,2,5}
71: 1000111 ~ {1,2,3,7}
83: 1010011 ~ {1,2,5,7}
89: 1011001 ~ {1,4,5,7}
101: 1100101 ~ {1,3,6,7}
113: 1110001 ~ {1,5,6,7}
271: 100001111 ~ {1,2,3,4,9}
283: 100011011 ~ {1,2,4,5,9}
307: 100110011 ~ {1,2,5,6,9}
313: 100111001 ~ {1,4,5,6,9}
331: 101001011 ~ {1,2,4,7,9}
397: 110001101 ~ {1,3,4,8,9}
409: 110011001 ~ {1,4,5,8,9}
419: 110100011 ~ {1,2,6,8,9}
421: 110100101 ~ {1,3,6,8,9}
433: 110110001 ~ {1,5,6,8,9}
457: 111001001 ~ {1,4,7,8,9}
1103: 10001001111 ~ {1,2,3,4,7,11}
1117: 10001011101 ~ {1,3,4,5,7,11}
1181: 10010011101 ~ {1,3,4,5,8,11}
1223: 10011000111 ~ {1,2,3,7,8,11}
MATHEMATICA
Select[Range[1000], DigitCount[Prime[#], 2, 1]-DigitCount[Prime[#], 2, 0]==1&]
CROSSREFS
Restriction of A031448 to the primes, positions of ones in A145037.
Taking primes gives A095073, negative A095072.
Positions of ones in A372516, absolute value A177718.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A070939 gives the length of an integer's binary expansion.
A101211 lists run-lengths in binary expansion, row-lengths A069010.
A372471 lists binary indices of primes.
Sequence in context: A060305 A009141 A090069 * A272528 A195676 A027299
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, May 13 2024
STATUS
approved