why not just brute force this? one little array contains [a, (a+d), (a+2d), (a+3d), (a+4d) ], which is then filtered so that none of those are multiples of another.
Then set a count variable to m-n+1. Check all numbers in range against your little array, decrementing count and breaking out if a divisible num is found. In Ruby, screenshot so that syntax highlighting remains. (comments start with # ) [image: Inline image 1] -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
<<image.png>>