Editorial is wrong for Problem code BASE

I was doing this problem Given some integer N, how many bases b are there such that the base-b representation of N starts with a 1?
I was unable to score full marks so I looked at editorial but the solution given in editorial is not working and solutions of problem setter and editorialist are not visible. Please help me understand what I am doing wrong link of editorial Link of my code