login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228175 Least positive k such that n^n * k^k + 1 is a prime, or 0 if no such k exists. 2

%I #30 Jan 03 2016 04:38:54

%S 1,1,1,2,1,6,5,2,7,10,8

%N Least positive k such that n^n * k^k + 1 is a prime, or 0 if no such k exists.

%C The next terms after the missing a(11) are 31, 58, 4, 596, 3.

%e 3^3 * 1 + 1 = 28 is not a prime, 3^3 * 2^2 + 1 = 109 is a prime, so a(3) = 2.

%o (Java)

%o import java.math.BigInteger;

%o public class A228175 {

%o public static void main (String[] args) {

%o for (int n = 0; n < 333; n++) {

%o BigInteger nn = BigInteger.valueOf(n).pow(n);

%o int k = 1;

%o for (; k<10000; k++) {

%o BigInteger kk = BigInteger.valueOf(k).pow(k).multiply(nn).add(BigInteger.ONE);

%o if (kk.isProbablePrime(80)) {

%o System.out.printf("%d, ", k);

%o break;

%o }

%o }

%o if (k==10000) System.out.printf("- ");

%o }

%o }

%o }

%o (PARI) A228175(n,L=9e9,s=1)={forstep(k=s+(bittest(n,0)&&n>1&&bittest(s,0)), L, 1+bittest(n,0), ispseudoprime(n^n*k^k+1)&&return(k))} \\ Optional args allow specification of start and limit for search; for odd n > 1, only check even k. - _M. F. Hasler_, Nov 03 2013

%Y Cf. A000040, A000312, A156223.

%K nonn,hard,more

%O 0,4

%A _Alex Ratushnyak_, Nov 02 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)