OFFSET
1,2
EXAMPLE
a(1) = 1 because in order for k*(1^3)+1 to be the smallest prime, k must be 1 (1*(1^3)+1 = 2).
a(2) = 2 because in order for k*(2^3)+1 to be the smallest prime, k must be 2 (2*(2^3)+1 = 17).
a(3) = 4 because in order for k*(3^3)+1 to be the smallest prime, k must be 4 (4*(3^3)+1 = 109).
MATHEMATICA
sk[n_]:=Module[{k=1, n3=n^3}, While[!PrimeQ[k*n3+1], k++]; k]; Array[sk, 80] (* Harvey P. Dale, Aug 27 2014 *)
Table[SelectFirst[Range[10^2], PrimeQ[# n^3 + 1] &], {n, 76}] (* Michael De Vlieger, Mar 27 2016, Version 10 *)
PROG
(Python)
import sympy
from sympy import isprime
def f(n):
..for k in range(1, 10**3):
....if isprime(k*(n**3)+1):
......return k
n = 1
while n < 10**3:
..print(f(n))
..n += 1
(PARI) a(n) = {k=1; while(!isprime(k*n^3+1), k++); k; } \\ Altug Alkan, Mar 26 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 06 2014
STATUS
approved