login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Least prime p such that n^p - (n-1)^p is composite.
2

%I #16 Oct 01 2013 17:57:44

%S 11,7,5,2,3,5,2,3,5,2,5,2,2,5,3,2,2,3,2,3,3,2,5,2,2,3,2,2,3,7,2,2,3,2,

%T 3,3,2,2,3,2,7,2,2,3,2,2,2,5,2,3,3,2,3,3,2,3,2,2,2,2,2,2,5,2,3,2,2,3,

%U 3,2,2,2,2,5,3,2,2,3,2,2,5,2,3,2,2,5,2

%N Least prime p such that n^p - (n-1)^p is composite.

%C The least n such that a(n) = p is found in A229073. - _Eric M. Schmidt_, Sep 12 2013

%H Eric M. Schmidt, <a href="/A087896/b087896.txt">Table of n, a(n) for n = 2..10000</a>

%t Table[p = 2; While[PrimeQ[n^p - (n - 1)^p], p = NextPrime[p]]; p, {n, 2, 88}] (* _T. D. Noe_, Sep 12 2013 *)

%o (PARI) a(n) = {forprime(p=2,default(primelimit),if(!isprime(n^p-(n-1)^p),return(p)))}

%K nonn

%O 2,1

%A _Cino Hilliard_, Oct 26 2003

%E Edited by _Charles R Greathouse IV_, Nov 02 2009