4 Comments
Aug 12, 2023Liked by Geoff Engelstein

I’m working on a game and there is a bit of adding and subtracting for each player every turn. First iteration had numbers 1-10. Next iteration 3 and 7 are gone which makes it a bit easier.

Expand full comment

Sometimes I find power-of-two grows too quickly, so I use what I call half power of 2, which (if you're also a camera buff) is what a cameras use for their f-stops. The sequence on a camera is 1.4, 2.0, 2.8, 4.0, 5.6, 8.0, 11, 16, 22, 32. You may notice that it doubles with every other number instead of every number. Mathematically, this works by starting with 1, then multiplying the previous number by the square root of 2. These get rounded down.

For a simple, clean implementation that doesn't stray from the sequence due to rounding errors, I start with 1 (or any power of 2). Call that n. The next two numbers are round((root 2) * n) and 2*n.

Expand full comment
author

I didn’t know this! This is very cool. Thanks.

Expand full comment

I’m working on a roll and write at the moment that uses the Fibonacci sequence! It also uses triangular numbers too.

Expand full comment