OFFSET
0,3
EXAMPLE
a(3) = 7 because 7 * 3^2 = 63, which ends with "3".
a(11) = 91 because 91 * 11^2 = 11011 which ends with "11".
a(22) = 0 because there is no "k" such that k*22^2 ends with 22.
MATHEMATICA
f[n_] := Block[{k = 1, n2 = n^2, m = Max[10^Floor[ Log[10, n] + 1], 10]}, While[k < 10^4 && Mod[k*n2, m] != n, k++ ]; If[k == 10^4, 0, k]]; Table[ f[n], {n, 85}] (* Robert G. Wilson v, Jul 02 2005 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Luca Colucci, Jun 29 2005
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 02 2005
STATUS
approved