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


0010 FUNC digit'sum(n)
0020   sum:=0
0030   WHILE n>0 DO sum:+n MOD 10;n:=n DIV 10
0040   RETURN sum
0050 ENDFUNC digit'sum
0060 //
0070 FUNC next'harshad(n)
0080   REPEAT
0090     n:+1
0100   UNTIL n MOD digit'sum(n)=0
0110   RETURN n
0120 ENDFUNC next'harshad
0130 //
0140 PRINT "First 20 Harshad numbers: "
0150 n:=0
0160 FOR i:=1 TO 20 DO
0170   n:=next'harshad(n)
0180   PRINT n;
0190 ENDFOR i
0200 PRINT
0210 PRINT "First Harshad number above 1000:";next'harshad(1000)
0220 END