OFFSET
1,4
LINKS
Andy Steward, Prime Generalized Repunits
EXAMPLE
a(5) = 8 because ithprime(5) = 11, (11^(2*m+1)-1)/10 is not a prime for m = 1..7 and (11^17-1)/10 = 50544702849929377 is a prime.
MATHEMATICA
Do[p=Prime[w]; s=DivisorSigma[1, (p^r)^2]; z=DivisorSigma[0, (p^r)^2]; If[PrimeQ[s], Print[{p, r, p^r, s, z}]], {w, 1, 100}, {r, 1, 100}] For w=12, this prints out first {37, 6, 2565726409, 6765811783780036261, 13}.
lm[n_]:=Module[{m=1}, While[!PrimeQ[(n^(2m+1)-1)/(n-1)], m++]; m]; lm/@Prime[ Range[ 56]] (* Harvey P. Dale, Feb 16 2014 *)
PROG
(PARI) { allocatemem(932245000); for (n=1, 100, x=prime(n); s=x^2; q=x - 1; m=1; while (!isprime(((x*=s) - 1)/q), m++); write("b065813.txt", n, " ", m) ) } \\ Harry J. Smith, Oct 31 2009
CROSSREFS
KEYWORD
hard,nonn
AUTHOR
Vladeta Jovovic and Labos Elemer, Nov 13 2001
STATUS
approved