The concept of a "random number" is a difficult one. Related: Chaitin, chaos theory, PseudoRandomNumberGenerators. Exact definitions that fit all purposes are difficult to come by, and intuition is misleading.
Perhaps someone would care to fill this page out properly? There are already many references to random numbers here and elsewhere.
There's not really such a thing as a random number in the real world. It's an idealization that can only truly exist in pure mathematics in the context of infinite sequences, despite the existence of random quantum processes in the real world.
Chaitin/Kolmogorov complexity required to reproduce a sequence of numbers is more to the point.
Moved from RandomNumbers:
"Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin." -- JohnVonNeumann
Don't live in sin...
RandomNumbers Here are some sources for generating real random numbers (as opposed to using a pseudorandom algorithm).
The underlying source may be truly random, if you're lucky (e.g. it is with hotbits), but (1) the distribution isn't what you want, because there are no true white noise generators in nature, and (2) bias is introduced in the sampling process (e.g. by the sampling aperture, amongst many other possibilities). Always.
PseudoRandom Numbers
There are also algorithms which are expected to generate PseudoRandom numbers indistinguishable by any efficient algorithm from real RandomNumbers.
This may be correct for the individual numbers, but is wrong (I think) for distributions of the numbers. That is, the distribution of an infinite number of truly random numbers within a range {0, 1} or {0, N} is flat, but the distribution of an infinite number of pseudorandom numbers is not flat (some numbers are never generated [How come? - because PRNGs have some periodicity to them, even if that periodicity is very large eventually the same sequence of numbers generated is repeated with no new numbers appearing]). -- AndyPiercel?
See also http://www.serve.net/buz/Notes.1st.year/HTML/C6/rand.002.html (BrokenLink - 20040415; archived at http://web.archive.org/web/20030128213033/http://www.serve.net/buz/Notes.1st.year/HTML/C6/rand.002.html.)
One time, I designed that old classic game of Guess the Number on my TI-82 in high school. I had the range be 0-100000 or so. I had a friend guess the correct number on the first time, every time. To this day, I don't know how he did it. We speculated that he was just inputting the variable back into the guess, but we tried it and couldn't get it to work. Any ideas?
Was each "guess" made after you had seen the number? If so, your friend could probably see the calculator display reflected in your spectacle lens or in the window behind you, or was having the number signed to him by someone else who could see the calculator. A schoolfriend and myself once both guessed 2.506 as a "random number", but "every time" suggests a simple method.
Nope, I hadn't seen the number first. I wish I had written down everything back then... I recall trying to figure out how he was doing it... but I don't recall sitting over his shoulder while he typed in the numbers. I may or may not have. I was gullible back then.
From your account, all that's relevant (unless the program was seriously flawed) is whether anyone could see the number produced by the calculator before the prediction of that same number occurred. One trick is simply to prevent you from verifying any predictions until a whole group have been made. By that time, it may be possible to make you think the numbers were announced in advance, although they were actually written down afterwards. To accomplish this, the guesser merely pretends to write his first prediction, then announces it as correct! He is then one prediction short, but slips in the final number when you aren't looking! It helps if the guesser has an accomplice who pretends to confirm all the predictions.
Perhaps your friend knew how to reset the seed of the random number generator. Then he memorized the first few "random" numbers that were generated. Imagine how easy that "Simon" 4-color memorization game would be if you could reset the seed.
See also UnitTestingRandomness