OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
2 is in the sequence because 2 and 2*2*1^2 - 1 = 3 are both primes.
MATHEMATICA
spp[n_]:=Module[{n2=n^2, p=2}, While[!PrimeQ[2p*n2-1], p=NextPrime[p]]; p]; Array[spp, 80] (* Harvey P. Dale, Jul 09 2017 *)
PROG
(PARI) a(n)=forprime(p=2, default(primelimit), if(isprime(2*p*n^2-1), return(p))) \\ Charles R Greathouse IV, Mar 09 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerasimov Sergey, Mar 09 2012
STATUS
approved