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


10 LET k=0: LET n=0
20 IF k=20 THEN GO TO 60
30 LET n=n+1: GO SUB 1000
40 IF isHarshad THEN PRINT n;" ";: LET k=k+1
50 GO TO 20
60 LET n=1001
70 GO SUB 1000: IF NOT isHarshad THEN LET n=n+1: GO TO 70
80 PRINT '"First Harshad number larger than 1000 is ";n
90 STOP 
1000 REM is Harshad?
1010 LET s=0: LET n$=STR$ n
1020 FOR i=1 TO LEN n$
1030 LET s=s+VAL n$(i)
1040 NEXT i
1050 LET isHarshad=NOT FN m(n,s)
1060 RETURN 
1100 DEF FN m(a,b)=a-INT (a/b)*b