OFFSET
1,1
PROG
(PARI) a(n, L=10^15) = if(issquare(n), L=2+n^2); for(k=2, L, if((k^2-1)%n==0, if(issquare(1+(k^2-1)/n), return(k))));
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Apr 13 2019
STATUS
approved