Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backtracking alternative #74

Open
ethers opened this issue Jan 27, 2016 · 0 comments
Open

backtracking alternative #74

ethers opened this issue Jan 27, 2016 · 0 comments

Comments

@ethers
Copy link
Owner

ethers commented Jan 27, 2016

1 idea is to use "roundness"

the "roundness" of a number is the largest power of 2 such that B % roundness = 0
6 has roundness 2
96 has roundness 32
basically it's the largest power of 2 that divides it

lets say you want to go from 117 to 1
you'd go 117[1] 116[4] 112[16] 96[32] 64...... 64 is special because it can't go 'up' any further, so maybe 64 just goes back half way to 32

for power of 2 one idea is go back halfway
if need to go up again, say we want 50, just restart back at 64 and backtrack one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant