Given r and n, find first n numbers of x where moving first digit of x to last gives x/r = y Objective

Given input r and n find the first n natural numbers x such that if we rotate the first digit to the last place we obtain x/r.

You may assume that 2 &lt;= r &lt;= 9 and 1 &lt;= n &lt;= 65535.

You may write a program which takes input from stdin or command-line arguments; or you may write a function which takes r and n as parameters. Output, however, should be to stdout. Output should be one line per value of x, formatted as x/r=y, in order of increasing x.

Your solution must be able to handle all valid cases within one minute on a reasonable desktop computer.

Test cases

Input: 4 5
Output:  

102564/4=25641  
205128/4=51282  
307692/4=76923  
410256/4=102564  
512820/4=128205


Input: 5 1
Output: 714285/5=142857  

This is code-golf, so least bytes win. Winning answer will be accepted 4 weeks from now (2014-09-19).  

Credits for this question go to my colleague, who allowed me to post this question here :)
Haskell, 182 179

Second version, probably further golfable, but with "proper" algorithm this time.  In particular, it finishes within a few minutes with r=4 and n=65535, but then again my computer is neither reasonable nor a desktop, so chances are this stays within a minute on other machines.

n#r=take n$[s(10^k*a+d)++'/':s r++'=':s d++s a|k&lt;-[0..],a&lt;-[1..9],let(d,m)=divMod(a*(10^k-r))(10*r-1),m&lt;1]
s=show
main=interact$unlines.(\(r:n:_)-&gt;n#fromIntegral r).map read.words


It is based on the idea that x=10^k*a + m, where its first digit 0≤a≤9 is moved to the end to obtain y=10*m+a.  A little maths reveals that m can be obtained as a*(10^k-r)/(10*r-1), so we simply scan a over [1..9] for every k from 0 to infinity, and keep and print the first n results for which the above expression for m is integral.

The fromIntegral is required because reading a list with n as one of its elements in main, in combination with the use of n in take, would force r to Int throughout, which results in nasty overflows with the big numbers in question.  I could have used genericTake, but that requires an import.

This code also has the benefit of being almost trivial to expand to bases other than 10.

Input is read from stdin, the two values can be separated by any whitespace.