OFFSET
1,1
EXAMPLE
For n=4, a(4)=31 and q=17 satisfy the desired divisibilities.
MAPLE
P:= select(isprime, [2, seq(i, i=3..100000, 2)]):
nP:= nops(P);
R:= NULL:
for i from 2 to nP do
p:= P[i];
for j from 1 to i-1 do
q:= P[j];
if p*q^2 + 1 mod ilcm(p+1, q^2+p) = 0 then
R:= R, p;
break
fi
od od:
R;
CROSSREFS
KEYWORD
nonn
AUTHOR
Stephen Bartell, May 22 2024
STATUS
approved