OFFSET
1,1
LINKS
EXAMPLE
n=1: p=2, q=11, (p+1)(q+1)=36=6^2, m=6;
a(2)=0 because there is no q > 3 such that (3+1)(q+1) is a square (because, for prime q >3, (q+1) cannot be a square);
n=3: p = 5, q = 23, (p + 1) (q + 1) = 144 = 12^2, m=12.
MATHEMATICA
Table[SelectFirst[Prime@ Range[n + 1, 10^4], IntegerQ@ Sqrt[(Prime@ n + 1) (# + 1)] &], {n, 102}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, Jul 09 2016, Version 10.2 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jul 09 2016
STATUS
approved