# Is it a Self-divisor? [duplicate]

Write a function or program that takes n as a parameter and prints the first n self-divisors.

# Definition of Self-divisor

A positive integer is called a “self-divisor” if every decimal digit of the number is a divisor of the number, that is, the number is evenly divisible by each and every one of its digits.

### Example

For example, the number 128 is a self-divisor because it is evenly divisible by 1, 2, and 8. However, 26 is not a self-divisor because it is not evenly divisible by the digit 6. Note that 0 is not considered to be a divisor of any number, so any number containing a 0 digit is NOT a self-divisor. There are infinitely many self-divisors.

# Scoring

This is code-golf, so the shortest answer in bytes wins

• This seems really familiar, I'm pretty sure I've golf this challenge here before, or at least one that determines if a number is a self-divisor, but I'm not finding it now. – xnor Apr 28 '20 at 3:22
• Are we allowed to take the index - 1, as per sequence defaults? (Or simply output the whole sequence) – user92069 Apr 28 '20 at 3:24
• @xnor I believe that is this question. Duplicate? – dingledooper Apr 28 '20 at 3:25
• @dingledooper Thanks, too bad SE search doesn't show that on the first page of "divide digit". – xnor Apr 28 '20 at 3:28
• I think this is a duplicate because the additional part of "output the first n" isn't enough to make it different. People should feel free to reopen if they feel otherwise. I guess there's an argument that the other question is too old and has weird rules? – xnor Apr 28 '20 at 3:30

# 05AB1E, 16 bytes

05AB1E probably has some sort of slice, but I failed to find it.

∞ʒDSÖß}ʒ0å_}ηs<è


Try it online!

# Explanation

∞                [1, 2, 3, ...]
ʒ               Filter all that satisfies:
DS                 its DigitS
Ö                is divisible
ß}              ßy the original number.
ʒ         Filter out ^ that satisfies:
0å_}         0 is å digit of the output.
ηs<è Trunctuatè by the input.

• I think this is missing 1 in the output – math junkie Apr 28 '20 at 3:19
• @mathjunkie Probably fixed. – user92069 Apr 28 '20 at 3:22
• 8 bytes in the legacy version of 05AB1E: µNDSÖPD– (The second and fourth bullet-points of this 05AB1E tip are relevant.) PS: £ is what you were probably looking for? – Kevin Cruijssen Apr 28 '20 at 12:47