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




var e = Enumerator({|f|
    for n in (1..Inf) {
 
        var k = 0
        while (k.sumdigits != n) {
            k += n
        }
 
        f(k/n)
    }
})
 
var N = 60
var A = []
 
e.each {|v|
    A << v
    say A.splice.map { '%7s' % _ }.join(' ') if (A.len == 10)
    break if (--N <= 0)
}