I am curious to understand how you can compute sequences like this one by Rémy Sigrist https://oeis.org/A279125
You can also see it in action in this numberphile video: https://youtu.be/j0o-pMIR8uk?t=371
What I struggle with is to understand how to compute these 'overlaps' they explain. I don't even know the right term for it... I guess it is connected to lowest order bit, but I don't understand it.
I started writing a function for it, but I need help with computing this bit comparison.
function remyF(n) {
let num = parseInt(n, 10);
return num.toString(2);
}
In python:
You should have no issue with
is_power_of_2. Thanks to Peter Foreman for informing me of numerous errors. And you should store previously computed values in a lookup table if you're going to use this code for any medium to large n.