Do you know anything about mathematics?
Not much, that's why i started with excusing myself.
See my example that crossed your entry. The only way is O(n) since it is sequential because it needs to be unrepeatable: for the brain deaf, you can't have two occurrences of the same number... Sigh, but anyway Look at my example. That is the most efficient.
Yes, i understand that each generated number cannot be repeated again... that's why PRNG LCG can be used using a special seed that guarantees for the generated number to be non repetitive _unless_ you managed to 'flip' around the max numbers that can be generated as then indeed the algorithm starts to repeat itself.
I am not an expert, nor do i have the mathematical skills to proof wrong or right. I did come across
this article that perhaps explains better what i meant.
See also:
In OpenBSD, we designed a non-repeating pseudo-random number generator that was very fast and did not require additional resources.
Ah i noticed to late you added some additional stuff ;-)
The fpc algorithm IS a prng, btw.... YOU SHOULD KNOW BETTER, MOLLY! Shame! (teacher speak
)
Yes, i am aware of that ;-)
Please feel free to educate with regards to the links i posted.
Can or can't it be used as a quick alternative for what you proposed (given that the sequence repeats itself when the max generated unique numbers is reached).