login
A306257
a(n) = t for the minimal integer k > t such that k^2 mod n = t^2 is a perfect square.
2
0, 0, 1, 0, 2, 2, 2, 1, 0, 3, 3, 2, 3, 3, 1, 0, 4, 0, 4, 4, 2, 4, 4, 1, 0, 5, 3, 5, 5, 2, 5, 2, 4, 5, 1, 0, 6, 6, 5, 3, 6, 4, 6, 6, 2, 6, 6, 1, 0, 0, 7, 7, 7, 6, 3, 5, 5, 7, 7, 2, 7, 7, 1, 0, 4, 8, 8, 8, 7, 2, 8, 3, 8, 8, 5, 8, 2, 7, 8, 1, 0, 9, 9, 4, 6, 9, 7, 9, 9, 4, 3, 9, 8, 9, 7, 2, 9, 0, 1, 0, 10, 8, 10, 9, 4
OFFSET
1,5
LINKS
FORMULA
a(n) = 0 <=> n > 0 and n in { A000290 } union { A077591 }.
MAPLE
a:= proc(n) local k; for k from (s-> `if`(s^2<n, s+1, s))(isqrt(n))
while not issqr(irem(k^2, n)) do od; isqrt(irem(k^2, n))
end:
seq(a(n), n=1..120);
CROSSREFS
Cf. A000290, A077591, A306271 (values of k).
Sequence in context: A176389 A076451 A230536 * A357316 A108839 A114898
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Feb 13 2019
STATUS
approved