Sarah83 Posted November 18, 2004 Report Share Posted November 18, 2004 Hi! I get a riddle per Mail. I thougt about solving the riddle with LV. But I don't know how to start. How could I set variables like x and y? Or factor deconstructing. For they which are interested in the riddle: This happends in barracks: "Form up in rows of two!"-- at first chaos, but then is's accomplished, but one soldier remains. "Form up in rows of three!"-- one soldier remains again. "Form up in rows of four!"-- one soldier remains again. "Form up in rows of five!"-- one soldier remains again. "Form up in rows of six!"-- one soldier remains again. "Form up in rows of seven!"-- finally, all soldiers stay in file. How much soldiers are this at least. (I hope I could translate this understandable from German ) Quote Link to comment
jpdrolet Posted November 18, 2004 Report Share Posted November 18, 2004 That's an easy one. The brute force solution: If you give more thought to the problem, you search for a number N divisible by 7 and (N-1) is divisible by 2,3,4,5 e.g.60. It has the form 60*n+1 so you find it with this simpler code: :!: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.