   interesting question i thought i would share.
  First off...no this is not an interview question (anymore), and second its not a homework problem (sinve i've graduated college).Find a number without using a program (algorithm or pure brute force only) that finds the lowest value for N.N / 3 = remainder 2N / 4 = remainder 3N / 5 = remainder 4N / 6 = remainder 5N / 7 = remainder 6N / 8 = remainder 7N / 9 = remainder 8~guyaton   
  I don't follow the question. Are we supposed to write a program to do this? Are we supposed to do it by hand? What's the actual thing we're meant to do, and what are the restrictions?   ;Quote:...without using a program...*should be "without writting a program"its to test your problem solving skills.~guyaton   ;  N / (x + 1) = x;N = (x + 1).x;N = x^2 + x;pick a x and i give you a N value...is that all? or am i missing somethingEDIT: smallest, hmm forgot bout that bitEDIT: im missing a lot apparently. i need sleep :)   ;  In each case the input is the same as the remainder.e.g.2/3 = remainder 23/4 = remainder 3n/(any number > n) = remainder n   ;Quote:Original post by rip-offN / (x + 1) = x;N = (x + 1).x;N = x^2 + x;pick a x and i give you a N value...is that all? or am i missing somethingThat will not give you the lowest value of N. My solution is to add the divsor and remainder together:N/3 = remainder 2 => 3+2 = 5  => 5/3 = 1R2N/6 = remainder 5 => 6+5 = 11 => 11/6 = 1R5...   ;Quote:Original post by acraigQuote:Original post by rip-offN / (x + 1) = x;N = (x + 1).x;N = x^2 + x;pick a x and i give you a N value...is that all? or am i missing somethingThat will not give you the lowest value of N. My solution is to add the divsor and remainder together:N/3 = remainder 2 => 3+2 = 5  => 5/3 = 1R2N/6 = remainder 5 => 6+5 = 11 => 11/6 = 1R5...Five isn't the smallest number that gives a remainder of two when divided by three - two is.   ;  Ah yes, in your case your solution is correct.  Interesting problem in that I automatically assumed N had to be greater than the divsor. I should have noticed that when all my answers were 1 and the remainder.   ;Quote:Original post by NitageFive isn't the smallest number that gives a remainder of two when divided by three - two is5 % 3 == 2, but 5 %9 != 8.It must be true for all of those cases (3 through 9). I am still working it out myself for fun, but I thought it would be fun for others of you as well.~guyaton   ;  Aha so you want 1 value of N that satisfies all cases.  Should have made that a little more clear :)   