The Harshad or Niven numbers are positive integers ≥ 1 that are divisible by the sum of their digits.

For example,   42   is a Harshad number as   42   is divisible by   (4 + 2)   without remainder.

Assume that the series is defined as the numbers in increasing order.



Task

The task is to create a function/method/procedure to generate successive members of the Harshad sequence.

Use it to:

   list the first 20 members of the sequence,   and
   list the first Harshad number greater than 1000.


Show your output here.



Related task
   Increasing gaps between consecutive Niven numbers


See also
    OEIS: A005349


100 PROGRAM "Harshad.bas"
110 LET I=1:LET CNT=0
120 PRINT "First 20 Harshad numbers are:"
130 DO
140   IF HARSHAD(I) THEN PRINT I;:LET CNT=CNT+1
150   LET I=I+1
160 LOOP UNTIL CNT=20
170 PRINT :PRINT :PRINT "First Harshad number larger than 1000 is";:LET I=1001
180 DO
190   IF HARSHAD(I) THEN PRINT I:EXIT DO
200   LET I=I+1
210 LOOP
220 DEF HARSHAD(NUM)
230   LET TMP=NUM:LET SUM=0
240   DO WHILE TMP>0
250     LET SUM=SUM+MOD(TMP,10)
260     LET TMP=INT(TMP/10)
270   LOOP
280   LET HARSHAD=MOD(NUM,SUM)=0
290 END DEF