number mirrored in all bases if, written in every base from 2 to number - 2 inclusive, its digits read the same left to right and right to left.
Return True if number is mirrored in all bases and False otherwise.
Checking every base directly works, but think about whether you can answer without computing anything at all.number=7 → False
In base 2, 7 = 111, a palindrome, but in base 3, 7 = 21, which is not.
number=4 → False
Only base 2 needs checking: 4 = 100, not a palindrome.
number=7
False
Run checks the first 3 tests in your browser. Submit checks all 58 tests on the server, hidden ones included.