# Easy way to generate random numbers?

How random this numbers look,

21081461046286104621816

Here the system I used to get them, first pick the seed,

13128

then add the value of the 2nd number to the 1st and write it between them and the 3rd to 2nd and write it between them and etc.

143213218

and repeat again 2nd to 1st etc. to get more numbers.

15473523143523198

last step double each number 1>2 5>20 etc.

21081461046286104621816

Is it random or not because I want to use as a one time pad. so is it random even if you know how I generate them?

-
Reminds me of xkcd.com/221. – gnometorule Dec 10 '12 at 17:26
Check out en.wikipedia.org/wiki/… (that's what you're trying to devise here). – Fixee Dec 10 '12 at 17:43

Your example is not at all random and is dangerous for the application you mention.

Perhaps you should look at the following methods of verifying the quality of random numbers. It is a difficult and very important topic in such things as simulations and cryptography.

Here are some of the test suites: PractRand, TestU01, RaBiGeTe, DIEHARD, DIEHARDER (search Google).

Additionally, you might want to read the TestU01 paper that describes the difficulties.

Lastly, you might want to have a look at:

http://en.wikipedia.org/wiki/Random_number_generation

http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator

http://en.wikipedia.org/wiki/List_of_random_number_generators

http://reference.wolfram.com/mathematica/tutorial/RandomNumberGeneration.html

http://www.random.org/

http://photonics.anu.edu.au/qoptics/Research/qrng.php

Maybe if you could describe what you are looking for these for in more detail, we could provide more guidance (if it is a One-Time-Pad, you need a high entropy quality source and that is as hard as it gets).

Enjoy -A

-
thanks for the links, gona read and study them and back again soon. – illsecure Dec 11 '12 at 7:28

Every manually generated number is not random. Computers generate mostly using modulo arithmetic (at their core), so called pseudo-random numbers. Good algorithms are well-understood. I suggest you pick one (eg, Wikipedia) if you care about 'good' properties. Your algorithm only generates a one-time number in a deterministic way, with a length that is constructed to be what you make it. So by no reasonable definition it is random. While pseudorandom algorithms also deterministically determine a sequence of pseudo-random numbers, at least it is a 'random-looking' sequence. In your case, you could just write your result down and say 'it looks random."

-
understood, thanks – illsecure Dec 11 '12 at 7:26

If you want to generate real random number then you must use current time as a variable and do some operation with them. But still they have a algorithm. A random number is free from algorithm

-

As pointed out above by @gnometorule, if you generate a number using an algorithm, it is not going to be random. Instead, you need to look at pseudorandom numbers. There are interesting ways to understand pseudorandom generators in the context of computational complexity. Very loosely speaking, if ahead of time you define your resources for determining whether some string of numbers is random (say you are allowed to use polynomial-time computable functions), then you can create a pseudorandom generator that produces strings that are impossible to distinguish from true random strings under these constraints. This is sometimes known as "computational indistinguishability".

You can read more about this in Oded Goldreich's book: A Primer on Pseudorandom Generators (MR2677397) or in the paper by Goldreich, Goldwasser, and Micali, "How to construct random functions" or in various other places...

-