Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #28 Mar 08 2020 00:05:57
%S 1,21,71,1179,2429,47571,1296179,8703821,26452429,526452429,
%T 13241296179,19473547571,2263241296179,2480526452429,67263241296179,
%U 932736758703821,4067263241296179,38602480526452429,461397519473547571
%N Smallest number that when squared is congruent to 41 mod 10^n.
%C 41 is the smallest number that is not a perfect square for which a sequence like this is well-defined. For 24, the sequence is 2,18,32 and then terminates because no square ends in 0024.
%C 41 is the first term of A188173, which lists other numbers with this property. - _T. D. Noe_, Mar 23 2011
%H Charles R Greathouse IV, <a href="/A187719/b187719.txt">Table of n, a(n) for n = 1..1000</a>
%e 71 qualifies because 71^2 is 5041 which ends in 041.
%t Table[Solve[x^2 == 41 && Modulus == 10^n, x, Mode -> Modular][[1, 2, 2]], {n, 21}] (* _T. D. Noe_, Mar 22 2011 *)
%o (Sage)
%o def A187719(n):
%o bposs = [0]
%o works = lambda x, j: (x^2) % (10^j) == 41 % (10^j)
%o for w in [0..n]:
%o bposs = list((i*10**w+b) for i,b in cartesian_product([[0..9], bposs]))
%o bposs = list(b for b in bposs if works(b, w))
%o final = list(b for b in bposs if works(b, n))
%o if final: return min(final) # _D. S. McNeil_, Mar 22 2011
%Y Cf. A188173.
%K nonn,easy
%O 1,2
%A _J. Lowell_, Mar 18 2011