Today I found this amazing question about representing numbers in negafibonacci over on Stack Overflow. The negafibonacci number system represents each integer as a sum of terms of the form using only the digits 0 and 1. I played around with the problem a bit and found a really cool algorithm that efficiently converts numbers into negafibonacci by subdividing the integers into different ranges bounded by Fibonacci numbers and using those ranges to decide which bits to include.

### Like this:

Like Loading...

*Related*