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




func SumDigits(N);      \Return sum of digits in N
int  N, S;
[S:= 0;
while N do
    [N:= N/10;
    S:= S + rem(0);
    ];
return S;
];
 
int  C, N, M;
[C:= 0; N:= 1;
repeat  M:= 1;
        while SumDigits(N*M) # N do M:= M+1;
        IntOut(0, M);
        C:= C+1;
        if rem (C/10) then ChOut(0, 9\tab\) else CrLf(0);
        N:= N+1;
until   C >= 40+30;
]