OFFSET
1,2
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
n = 1: 1^2 + 1^2 + 1 = 3 is prime, so a(1) = 1.
n = 2: 1^2 + 2^2 + 1 = 6, 2^2 + 2^2 + 1 = 9, 3^2 + 2^2 + 1 = 14, 4^2 + 2^2 + 1 = 21, 5^2 + 2^2 + 1 = 30 are composite, but 6^2 + 2^2 + 1 = 41 is prime, so a(2) = 6.
n = 27: 1^2 + 27^2 + 1 = 731 = 17*43, 2^2 + 27^2 + 1 = 734 = 2*367 are composite, but 3^2 + 27^2 + 1 = 739 is prime, so a(27) = 3.
MATHEMATICA
snm[n_]:=Module[{c=n^2+1, x=NextPrime[n^2+1]}, While[!IntegerQ[Sqrt[x-c]], x= NextPrime[x]]; Sqrt[x-c]]; Array[snm, 100] (* Harvey P. Dale, Sep 22 2018 *)
PROG
(Magma) S:=[]; for n in [1..100] do q:=n^2+1; m:=1; while not IsPrime(m^2+q) do m+:=1; end while; Append(~S, m); end for; S; // Klaus Brockhaus, May 21 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ulrich Krug (leuchtfeuer37(AT)gmx.de), Apr 23 2009
EXTENSIONS
Edited and extended by Klaus Brockhaus, May 21 2009
STATUS
approved