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


HAI 1.3
 
HOW IZ I digsummin YR num
    I HAS A digsum ITZ 0
    IM IN YR LOOP
        num, O RLY?
            YA RLY
                digsum R SUM OF digsum AN MOD OF num AN 10
                num R QUOSHUNT OF num AN 10
            NO WAI, FOUND YR digsum
        OIC
    IM OUTTA YR LOOP
IF U SAY SO
 
I HAS A found ITZ 0
 
IM IN YR finder UPPIN YR n
    I HAS A n ITZ SUM OF n AN 1
    I HAS A digsum ITZ I IZ digsummin YR n MKAY
 
    NOT MOD OF n AN digsum, O RLY?
        YA RLY
            DIFFRINT found AN BIGGR OF found AN 20, O RLY?
                YA RLY
                    VISIBLE n " "!
                    found R SUM OF found AN 1
            OIC
 
            DIFFRINT n AN SMALLR OF n AN 1000, O RLY?
                YA RLY, VISIBLE ":)" n, GTFO
            OIC
    OIC
IM OUTTA YR finder
 
KTHXBYE