A285642 Smallest Brazilian prime in base n, or 0 if no such prime exists.
7, 13, 0, 31, 43, 2801, 73, 0, 1111111111111111111, 50544702849929377, 157, 30941, 211, 241, 0, 307
Offset: 2
Keywords
Examples
a(7) = (7^5 - 1)/6 = 11111_7 = 1 + 7 + 7^2 + 7^3 + 7^4 = 2801. a(10) is the repunit R_19 which is a string of nineteen 1's.
Links
- H. Dubner, Generalized repunit primes, Math. Comp., 61 (1993), 927-930.
Programs
-
Mathematica
Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[Set[x, (m^k - 1)/(m - 1)]], k++]; x, 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 *)
Comments