OFFSET
1,6
LINKS
Winston de Greef, Table of n, a(n) for n = 1..10000
MATHEMATICA
nmax=86; a={}; For[n=1, n<=nmax, n++, For[k=1, k>0, k++, If[IntegerQ[Sqrt[Mod[Floor[Sqrt[n k]+1]^2, n]]], AppendTo[a, k]; k=-1]]]; a (* Stefano Spezia, Apr 24 2023 *)
PROG
(Python)
from gmpy2 import is_square, isqrt
def a(n):
m, k = 2, 0
while not is_square(m):
k+=1
m = pow(isqrt(n * k) + 1, 2, n)
return k
(PARI) a(n) = my(k=1); while(!issquare((sqrtint(n*k)+1)^2 % n), k++); k; \\ Michel Marcus, Apr 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Apr 22 2023
STATUS
approved