OFFSET
1,1
COMMENTS
a(n) = 1 iff n-1 is prime.
If a(n) = 0 then n is in A097764. Note the converse is not true: a(4) = 1, not 0.
Up to a(1000), the largest term is a(456) = 947310. The PFGW program has been used to certify all the terms up to a(1000), using the 'N+1' deterministic test. - Giovanni Resta, Mar 30 2014
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
EXAMPLE
1*1^1 - 1 = 0 is not prime. 1*2^1 - 1 = 1 is not prime. 1*3^1 - 1 = 2 is prime. Thus a(1) = 3.
MATHEMATICA
nope[n_] := n > 4 && Catch@Block[{p = 2}, While[n >= p^p, If[ IntegerQ[ n^(1/p)/p], Throw@ True]; p = NextPrime@ p]; False]; a[n_] := If[nope@ n, 0, Block[{k = 1}, While[! PrimeQ[n*k^n - 1], k++]; k]]; Array[a, 80] (* Giovanni Resta, Mar 30 2014 *)
A239938[n_] := If[n != 4 && # != 1 && GCD[n, #] != 1 &[GCD @@ FactorInteger[n][[All, -1]]], 0, NestWhile[# + 1 &, 1, Not@PrimeQ[n #^n - 1] &]]; Array[A239938, 73] (* JungHwan Min, Dec 28 2015 *)
PROG
(PARI) Pro(n) = for(k=1, 10^4, if(ispseudoprime(n*k^n-1), return(k)));
n=1; while(n<100, print1(Pro(n), ", "); n+=1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 29 2014
STATUS
approved