Why's that? Is it the requirements for an assignment or something? I cannot just give you the answer here because it violates this forums rules on spoon feeding answers. The only hint I can give you is that you should put a break point in the checkGCD(int values)
method and watch what happens to the values
parameter each time the method is called. Consider how you need to alter the parameters so it will behave the same way the regular nested for loop would. If you haven't yet done so, I'd recommend writing a nested for loop solution so you can verify the output of the recursive one and compare them.