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

%I #14 Jul 10 2024 15:03:17

%S 2,11,47,139,157,191,1151,1531,3067,7159,20479,36857,49139,98299,

%T 360439,917503,1310719,786431,6291449,5242877,20971507,58720253,

%U 83886053,201326557,335544301,402653171,3489660919,1879048183,5368709117,25769803751,21474836479,77309411323

%N 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.

%e a(n): 2 11 47 139 157

%e np 3 13 53 149 163

%e [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]

%e [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]

%e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^

%e n: 1 2 3 4 5

%o (Python)

%o from sympy import nextprime

%o def A374179(n):

%o p, pb = 2, 2

%o while (q:=nextprime(p)):

%o if pb==(qb:=q.bit_length()) and (p^q).bit_count() == n:

%o return p

%o p, pb = q, qb # _Chai Wah Wu_, Jul 10 2024

%Y Cf. A000120, A000788, A007088, A061712, A205510, A374178.

%K nonn,base,new

%O 1,1

%A _Hugo Pfoertner_, Jul 09 2024

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 19:27 EDT 2024. Contains 374334 sequences. (Running on oeis4.)