Если на паскале, то как-то так:
function ToNine(number : integer) : integer;
const
sist = 9;
var
res, umn : integer;
begin
res := 0;
umn := 1;
while number > 0 do
begin
res := (number mod sist) * umn + res;
number := number div sist;
umn := umn * 10;
end;
ToNine := res;
end;
var
i : integer;
begin
for i := 1 to 8 do
writeln(i, ' + ', i, ' = ', ToNine(i + i));
for i := 1 to 8 do
writeln(i, ' * ', i, ' = ', ToNine(i * i));
end.