OFFSET
2,1
COMMENTS
All nonzero terms are odd primes.
a(n) = 0 for n = {4,9,16,25,32,36,49,64,81,100,121,125,144,...}, which are the perfect powers with exceptions of the form n^(p^m) where p>2 and (n^(p^(m+1))-1)/(n^(p^m)-1) are prime and m>=1 (in which case a(n^(p^m))=p). - Max Alekseyev, Jan 24 2009
a(n) = 3 for n in A002384, i.e., for n such that n^2 + n + 1 is prime.
a(152) > 20000. - Eric Chen, Jun 01 2015
a(n) is the least number k such that (n^k - 1)/(n-1) is a Brazilian prime, or 0 if no such Brazilian prime exists. - Bernard Schott, Apr 23 2017
These corresponding Brazilian primes are in A285642. - Bernard Schott, Aug 10 2017
a(152) = 270217, see the top PRP link. - Eric Chen, Jun 04 2018
a(184) = 16703, a(200) = 17807, a(210) = 19819, a(306) = 26407, a(311) = 36497, a(326) = 26713, a(331) = 25033; a(185) > 66337, a(269) > 63659, a(281) > 63421, and there are 48 unknown a(n) for n <= 1024. - Eric Chen, Jun 04 2018
Six more terms found: a(522)=20183, a(570)=12907, a(684)=22573, a(731)=15427, a(820)=12043, a(996)=14629. - Michael Stocker, Apr 09 2020
LINKS
Max Alekseyev and Eric Chen, Table of n, a(n) for n = 2..184 (terms 2..151 from Max Alekseyev)
Eric Chen, Table of n, a(n) for n = 2..1024 status (updated by Jinyuan Wang)
H. Dubner, Generalized repunit primes, Math. Comp., 61 (1993), 927-930.
Richard Fischer, Generalized repunit primes of the form (B^N-1)/(B-1)
Top PRPs, Search by (152^n-1)/(152-1)
Top PRPs, Search by (b^n-1)/a
Eric Weisstein's World of Mathematics, Repunit
EXAMPLE
a(7) = 5 because (7^5 - 1)/6 = 2801 = 11111_7 is prime and (7^k - 1)/6 = 1, 8, 57, 400 for k = 1, 2, 3, 4. - Bernard Schott, Apr 23 2017
MATHEMATICA
Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[(m^k - 1)/(m - 1)], k++]; k, 0]]@ If[Set[e, GCD @@ #[[All, -1]]] > 1, {#, IntegerExponent[n, #]} &@ Power[n, 1/e] /. {{k_, m_} /; Or[Not[PrimePowerQ@ m], Prime@ m, FactorInteger[m][[1, 1]] == 2] :> 0, {k_, m_} /; m > 1 :> n}, n] &@ FactorInteger@ n, {n, 2, 17}] (* Michael De Vlieger, Apr 24 2017 *)
PROG
(PARI) a052409(n) = my(k=ispower(n)); if(k, k, n>1)
a052410(n) = if (ispower(n, , &r), r, n)
is(n) = issquare(n) || (ispower(n) && !ispseudoprime((n^a052410(a052409(n))-1)/(n-1)))
a(n) = if(is(n), 0, forprime(p=3, 2^16, if(ispseudoprime((n^p-1)/(n-1)), return(p)))) \\ Eric Chen, Jun 01 2015, corrected by Eric Chen, Jun 04 2018, after Charles R Greathouse IV in A052409 and Michel Marcus in A052410
CROSSREFS
Cf. A002384, A049409, A100330, A162862, A217070-A217089. (numbers b such that (b^p-1)/(b-1) is prime for prime p = 3 to 97)
Cf. A000043, A028491, A004061, A004062, A004063, A004023, A005808, A004064, A016054, A006032, A006033, A006034, A133857, A006035, A127995, A127996, A127997, A204940, A127998, A127999, A128000, A181979, A098438, A128002, A209120, A185073, A128003, A128004, A181987, A128005, A239637, A240765, A294722, A242797, A243279, A267375, A245237, A245442, A173767. (numbers n such that (b^n-1)/(b-1) is prime for b = 2 to 53)
A126589 gives locations of zeros.
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, Feb 20 2007
EXTENSIONS
a(18) = 25667 found by Henri Lifchitz, Sep 26 2007
STATUS
approved