Strictly Palindromic Number
An integer n is strictly palindromic if, for every base b between 2 and n - 2 (inclusive), the string representation of the integer n in base b is palindromic.
Given an integer n, return true if n is strictly palindromic and false otherwise.
A string is palindromic if it reads the same forward and backward.
Example 1
Input
n = 9Output
falseIn base 3,
9 is represented as 100, which is not palindromic, so 9 is not strictly palindromic.Example 2
Input
n = 4Output
falseOnly base 2 is considered, and
4 is represented as 100, which is not palindromic.Constraints
- 4 <= n <= 10^5