\starttext
\startluacode
context.startxtable{ align =
"middle,lohi", bodyfont = "9pt", framecolor = "black" }
context.startxrow{ background = "color", backgroundcolor =
"lightgray" }
context.startxcell{ nx = 4 }
context("Units digit of")
context.stopxcell()
context.stopxrow()
context.startxrow()
context.startxcell{ width = "1cm" }
context.im("a")
context.stopxcell()
context.startxcell{ width = "1cm" }
context.im("a^2")
context.stopxcell()
context.startxcell{ width
= "1cm" }
context.im("b")
context.stopxcell()
context.startxcell{ width = "1cm" }
context.im("2b^2")
context.stopxcell()
context.stopxrow()
for i = 0,9 do
context.startxrow()
for
j = 1,4 do
context.startxcell()
if j == 1 then
context(i)
elseif j
== 2 then
context(math.mod(i*i,10))
elseif j == 3 then
context(i)
else
context(math.mod(2*i*i,10))
end
context.stopxcell()
end
context.stopxrow()
end