OFFSET
1,2
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..1000
EXAMPLE
71 qualifies because 71^2 is 5041 which ends in 041.
MATHEMATICA
Table[Solve[x^2 == 41 && Modulus == 10^n, x, Mode -> Modular][[1, 2, 2]], {n, 21}] (* T. D. Noe, Mar 22 2011 *)
PROG
(Sage)
def A187719(n):
bposs = [0]
works = lambda x, j: (x^2) % (10^j) == 41 % (10^j)
for w in [0..n]:
bposs = list((i*10**w+b) for i, b in cartesian_product([[0..9], bposs]))
bposs = list(b for b in bposs if works(b, w))
final = list(b for b in bposs if works(b, n))
if final: return min(final) # D. S. McNeil, Mar 22 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
J. Lowell, Mar 18 2011
STATUS
approved