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.

A084832 Numbers k such that 2*R_k - 1 is prime, where R_k = 11...1 is the repunit (A002275) of length k.

Original entry on oeis.org

4, 18, 100, 121, 244, 546, 631, 1494, 2566, 8088, 262603, 282948, 359860
Offset: 1

Views

Author

Jason Earls, Jun 05 2003

Keywords

Comments

Also numbers k such that (2*10^k-11)/9 is prime.
Larger values correspond to strong pseudoprimes.
a(11) > 10^5. - Robert Price, Sep 06 2014

Examples

			a(1) = 4 because 2*(10^4-1)/9-1 = 2221 is prime.
a(2) = 18 means that 222222222222222221 is prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(2*(10^t-1)/9-1),[$1..1000]); # Robert Israel, Sep 07 2014
  • Mathematica
    Do[ If[ PrimeQ[2(10^n - 1)/9 - 1], Print[n]], {n, 0, 7000}] (* Robert G. Wilson v, Oct 14 2004; fixed by Derek Orr, Sep 06 2014 *)
  • PARI
    for(n=1, 10^4, if(ispseudoprime(2*(10^n-1)/9-1), print1(n,", "))) \\ Derek Orr, Sep 06 2014
    
  • Python
    from sympy import isprime
    def afind(limit):
      n, twoRn = 1, 2
      for n in range(1, limit+1):
        if isprime(twoRn-1): print(n, end=", ")
        twoRn = 10*twoRn + 2
    afind(700) # Michael S. Branicky, Apr 18 2021

Formula

a(n) = A056660(n) + 1.

Extensions

a(8) from Labos Elemer, Jul 15 2004
a(10) from Kamada data by Robert Price, Sep 06 2014
a(11)-a(13) from Kamada data by Tyler Busby, Apr 29 2024