Coursera interview question

Magical Binary Numbers