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




01.10 F N=1,40;D 2
01.20 Q
 
02.10 S M=0
02.20 S M=M+1
02.30 S D=N*M
02.40 D 3
02.50 I (N-S)2.2,2.6,2.2
02.60 T "N",%2,N," M",%6,M,!
 
03.10 S S=0
03.20 S E=FITR(D/10)
03.30 S S=S+(D-E*10)
03.40 S D=E
03.50 I (-D)3.2