News for hackers. Stuff that matters.
Re:An RNG that runs in your brain by andrewla on Tuesday January 23, 2024 @10:00AM (#39104177)
I often use the Fibonacci numbers mod 10 when I need to do this in my head. It isn't great -- odd numbers are twice as frequent (because mod 2 they're [1,1,0]) and you get sequences like [7,0,7,7], but easy to keep track of and the cycle is 60 elements long.

The other one I use sometimes is the powers of 2 mod 100 and use the leading digit. This gives a cycle length of 20 with a flat distribution.

Re:An RNG that runs in your brain by librasteve on Tuesday January 23, 2024 @01:08PM (#39107148)
can try that in raku like this

> (1, 1, * + * ... Inf)[^42].pick mod 10