A367081 The least k such that exactly n binary near-repunit primes can be formed from 2^k-1 by changing one digit from 1 to 0.
1, 3, 4, 6, 8, 12, 38, 24, 18, 36, 48, 20, 248, 588, 144, 252, 5520, 168, 7200, 2400, 2850
Offset: 0
Examples
a(3)=6 because 2^6 - 1 = 111111_2 and 1) 111101_2 = 61, 2) 111011_2 = 59, 3) 101111_2 = 47, and no other k < 6 yields exactly three primes.
Programs
-
PARI
a(n) = my(k=1); while(sum(i=1, k-2, ispseudoprime(2^k-1-2^i)) != n, k++); k \\ Thomas Scheuerle, Nov 07 2023
-
Python
from itertools import count from sympy import isprime def A367081(n): for k in count(1): a, c = (1<
= n+1: break if c == n: return k # Chai Wah Wu, Nov 11 2023
Comments