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!)
A374179 a(n) is the least prime p such that the binary expansions of p and of the next prime q > p differ at exactly n positions, and p and q have the same binary length. 0
2, 11, 47, 139, 157, 191, 1151, 1531, 3067, 7159, 20479, 36857, 49139, 98299, 360439, 917503, 1310719, 786431, 6291449, 5242877, 20971507, 58720253, 83886053, 201326557, 335544301, 402653171, 3489660919, 1879048183, 5368709117, 25769803751, 21474836479, 77309411323 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(n): 2 11 47 139 157
np 3 13 53 149 163
[1 0] [1 0 1 1] [1 0 1 1 1 1] [1 0 0 0 1 0 1 1] [1 0 0 1 1 1 0 1]
[1 1] [1 1 0 1] [1 1 0 1 0 1] [1 0 0 1 0 1 0 1] [1 0 1 0 0 0 1 1]
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
n: 1 2 3 4 5
PROG
(Python)
from sympy import nextprime
def A374179(n):
p, pb = 2, 2
while (q:=nextprime(p)):
if pb==(qb:=q.bit_length()) and (p^q).bit_count() == n:
return p
p, pb = q, qb # Chai Wah Wu, Jul 10 2024
CROSSREFS
Sequence in context: A106980 A089682 A211671 * A198693 A178710 A050929
KEYWORD
nonn,base,new
AUTHOR
Hugo Pfoertner, Jul 09 2024
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 July 15 15:15 EDT 2024. Contains 374333 sequences. (Running on oeis4.)