login
A084832
Numbers k such that 2*R_k - 1 is prime, where R_k = 11...1 is the repunit (A002275) of length k.
5
4, 18, 100, 121, 244, 546, 631, 1494, 2566, 8088, 262603, 282948, 359860
OFFSET
1,1
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
FORMULA
a(n) = A056660(n) + 1.
EXAMPLE
a(1) = 4 because 2*(10^4-1)/9-1 = 2221 is prime.
a(2) = 18 means that 222222222222222221 is prime.
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 *)
PROG
(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
KEYWORD
more,nonn
AUTHOR
Jason Earls, Jun 05 2003
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
STATUS
approved