Generate the sequence a(n) when each element is the minimum integer multiple m such that the digit sum of n times m is equal to n.



Task
 Find the first 40 elements of the sequence.


Stretch
 Find the next 30 elements of the sequence.


See also
 OEIS:A131382 - Minimal number m such that Sum_digits(n*m)=n




c = 0
n = 1
while c < 70
    m = 1
    while 1
        nm = n*m
		t = 0
        while nm
            t += nm mod 10
            nm = floor(nm / 10)
        end while
        if t = n then exit while
        m += 1
    end while
    c += 1
    print rjust(string(m), 8); " ";
    if c mod 10 = 0 then print
    n += 1
end while
end