我认为一个好的候选人是斐波那契线性反馈移位寄存器 (LFSR).
您可以从以下位置获取相关信息和算法维基百科 http://en.wikipedia.org/wiki/Linear_feedback_shift_register.
只是摘录:
The initial value of the LFSR is called the seed, and because the operation
of the register is deterministic, the stream of values produced by the
register is completely determined by its current (or previous) state.
Likewise, because the register has a finite number of possible states, it must
eventually enter a repeating cycle. However, an LFSR with a well-chosen
feedback function can produce a sequence of bits which appears random and
which has a very long cycle.
The only problem is that the periods for the LFSR are always of the form 2N-1.
You could overcome this noting that for any wanted period P, choosing the N that gives you the "next" 2N-1 value leaves potentially 2(N-1)-1 numbers to supress from the cycle (because if you need to supress more than that, just generate with N-1).
So, to supress k values (k = ((2N-1) - P) ⋳ {1 ... ,2(N-1)-1}) you can add a little logic such as
If (Mod(cur,2(N-1)+1-k) == 0) Then
cur=Mod(cur+1,2N-1)