

A128164


Least k>2 such that (n^k1)/(n1) is prime, or 0 if no such prime exists.


9



3, 3, 0, 3, 3, 5, 3, 0, 19, 17, 3, 5, 3, 3, 0, 3, 25667, 19, 3, 3, 5, 5, 3, 0, 7, 3, 5, 5, 5, 7, 0, 3, 13, 313, 0, 13, 3, 349, 5, 3, 1319, 5, 5, 19, 7, 127, 19, 0, 3, 4229, 103, 11, 3, 17, 7, 3, 41, 3, 7, 7, 3, 5, 0, 19, 3, 19, 5, 3, 29, 3, 7, 5, 5, 3, 41, 3, 3, 5, 3, 0, 23, 5, 17, 5, 11, 7, 61, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

2,1


COMMENTS

a(n) = A084740(n) for all n except n = p1, where p is an odd prime, for which A084740(n) = 2.
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^k1)/(n1) is a Brazilian prime, or 0 if no such Brazilian prime exists.  Bernard Schott, Apr 23 2017


LINKS

Max Alekseyev, Table of n, a(n) for n = 2..151
Eric Chen, Table of n, a(n) for n = 2..1001 status
H. Dubner, Generalized repunit primes, Math. Comp., 61 (1993), 927930.
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) = if(ispower(n), ispower(n), n>1)
a052410(n) = n^(1/a052409(n))
is(n) = issquare(n)  (ispower(n) && !ispseudoprime((n^a052410(n)1)/(n1)))
a(n) = if(is(n), 0, forprime(p=3, 6000, if(ispseudoprime((n^p1)/(n1)), return(p)))) \\ Eric Chen, Jun 01 2015


CROSSREFS

Cf. A084738, A065854, A084740, A084741, A065507, A084742.
Cf. A085104, A002384, A049409, A100330.
A126589 gives locations of zeros.
Sequence in context: A084055 A084103 A036477 * A260636 A245256 A140686
Adjacent sequences: A128161 A128162 A128163 * A128165 A128166 A128167


KEYWORD

nonn


AUTHOR

Alexander Adamchuk, Feb 20 2007


EXTENSIONS

a(18) = 25667 found by Henri Lifchitz, Sep 26 2007


STATUS

approved



