This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A306257 #40 Feb 18 2019 20:01:06 %S A306257 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, %T A306257 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, %U A306257 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 %N A306257 a(n) = t for the minimal integer k > t such that k^2 mod n = t^2 is a perfect square. %H A306257 Alois P. Heinz, <a href="/A306257/b306257.txt">Table of n, a(n) for n = 1..20000</a> %F A306257 a(n) = 0 <=> n > 0 and n in { A000290 } union { A077591 }. %p A306257 a:= proc(n) local k; for k from (s-> `if`(s^2<n, s+1, s))(isqrt(n)) %p A306257 while not issqr(irem(k^2, n)) do od; isqrt(irem(k^2, n)) %p A306257 end: %p A306257 seq(a(n), n=1..120); %Y A306257 Cf. A000290, A077591, A306271 (values of k). %K A306257 nonn,look %O A306257 1,5 %A A306257 _Alois P. Heinz_, Feb 13 2019