OFFSET
1,1
COMMENTS
EXAMPLE
a(3)=13 because A002496(3)=17, and 17 divides 13^2+1= 2*5*17.
MAPLE
with(numtheory):
nn:=1000:
for i from 1 to nn do:
p:=i^2+1:
if type(p, prime)=true
then
ii:=0:
for k from i+1 to 10^6 while(ii=0) do:
if irem(k^2+1, p)=0
then
ii:=1:printf(`%d, `, k):
else
fi:
od:
fi:
od:
MATHEMATICA
Clear[m]; m[1]=1; m[2]=2; m[n_] := m[n] = For[j = m[n-1]+2, True, j = j+2, If[PrimeQ[j^2+1], Return[j]]]; a[n_] := For[k = m[n]+1, True, k++, If[ Divisible[k^2+1, m[n]^2+1], Return[k]]]; Array[a, 50] (* Jean-François Alcover, Jul 21 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jul 10 2015
STATUS
approved