I remember from a long time ago (about 40 years, believe it or not) learning how to convert a repeating decimal into a fraction... like .33333... = 1/3. That one is obvious, but what about something like .571428571428... = 4/7?

Can anyone show me the procedure for that?

Then, a peripherally related question. First a bit of background. My software at work has hidden menus that can only be accessed with help from technical support, things like to "unpost a transaction from accounts receivable" or "reset conflict flags". Stuff that the end user isn't supposed to do without assistance. And I don't do these things without their help. But I couldn't resist the challenge of accessing those hidden menus.

Their method is this: I key in the magical access request code (Shift-F9), and it generates a random number. I read this number to the tech support guy (superb technical support, by the way -- should be, we're paying almost $800 a month licensing fee for the software!) and he reads back the reply number which I key in, and voila! I'm at the hidden menu.

They have assured me that I will never be able to figure out the algorithm for generating that reply number. Imagine their surprise when I informed them last week that multiplying their random number by .9153818 and discarding everything in the result to the right of the decimal point, I got a number that accessed the hidden menus.

This loosened their tongues enough to admit to me that while my method worked, it was not how they generated their number. They multiply the random number by an integer, then divide that number by another integer to get their access number. That would be the same as multiplying by a fraction.... wouldn't it? But what kind of fraction could be multiplied by a random integer and give an integer result? Could .9153817 plus a few more digits be part of a repeating decimal that could be turned into a fraction?

As I said, they were surprised when I came up with the .9153818 thing, but they will be truly astonished if I can reverse-engineer their method of generating the reply number and come up with the multiplicand and divisor for their random number. I am guessing that there are no more than three digits in either number, because they come up with the answer just about as fast as I can read them the query.

The .9153818 always generates a number slightly larger than the integer required for access (thus, my dropping of the digits to the right of the decimal). Now the question: Given the above information, how do they generate their integer answer to the random number query?

Below are samples of the random number, followed by the reply number:

8465857 7749491
4457902 4080682
3331257 3049372
4469755 4091532
5227746 4785383
9595194 8783265

Any ideas?

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"