A374178 a(n) is the least prime p such that p and the next prime > p have exactly n common 1's in their binary expansion.
2, 5, 19, 29, 181, 359, 379, 983, 3821, 3581, 8179, 16111, 81901, 98297, 131059, 131063, 524269, 917471, 3145679, 4128763, 16744423, 16776187, 58720223, 117440381, 266330047, 468713467, 536870879, 1073741309, 2147483629, 4294967231, 8589410287, 33285865469
Offset: 1
Examples
a(n): 2 5 19 29 181 np 3 7 23 31 191 [1 0] [1 0 1] [1 0 0 1 1] [1 1 1 0 1] [1 0 1 1 0 1 0 1] [1 1] [1 1 1] [1 0 1 1 1] [1 1 1 1 1] [1 0 1 1 1 1 1 1] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ n: 1 2 3 4 5
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..100
Programs
-
Python
from sympy import nextprime def A374178(n): p = 2 while (q:=nextprime(p)): if (p&q).bit_count() == n: return p p = q # Chai Wah Wu, Jul 08 2024
Comments