We say two positive integers are anagrams of each other if the digits in one of them (in decimal representation) can be rearranged to form the other. Leading zeros don't count. For example, 110020222 is an anagram of 212102020, but not of 221100011; neither is 22002211 even though it can be written as 022002211.
Interestingly enough, every arithmetic sequence of positive integers contains arbitrarily large sets of elements, all anagrams of each other. In this challenge, we use a special case of this fact.
Task
For this challenge, you have to write a program or function in a language of your choice, that takes as input two positive integers: k
and N
, and outputs N
different positive integers, all of which are multiples of k
and anagrams of each other.
Rules
- You can assume
N
is bigger than 1. - Input and output can be taken in any of the standard ways.
- Standard loopholes are forbidden.
- Output may contain spaces and newlines.
Winning Criterion
This is code-golf, so shortest code in bytes wins.
Examples
Note that there are more than one possible output (infinitely many, in fact) given any k
and N
. Here are some examples:
k | N | Possible output -----+-------+------------------ 9 | 4 | 234 | | 243 | | 342 | | 432 -----+-------+------------------ 351 | 6 | 142857 | | 428571 | | 285714 | | 857142 | | 571428 | | 714285