cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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.

Original entry on oeis.org

1, 3, 4, 6, 8, 12, 38, 24, 18, 36, 48, 20, 248, 588, 144, 252, 5520, 168, 7200, 2400, 2850
Offset: 0

Views

Author

Robert Price, Nov 06 2023

Keywords

Comments

Similar to A065083 but using binary repdigits instead of base 10.
Note that as in A065083, the most significant digit/bit is not replaced with a zero in determining a prime.
a(21) > 7800.
a(25) = 11520 and a(n) > 12000 for n in 21..24 and n > 25 using A272143. - Michael S. Branicky, Nov 09 2023

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.
		

Crossrefs

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
Showing 1-1 of 1 results.