For the purpose of this challenge, a smaller-base palindrome (SBP) is a number which is palindromic in a base between 1 and itself (exclusive), and is not a repdigit in the same base. For example, 5 is a SBP because it is a palindrome in base 2 (101). The first few SBPs are 5,9,10,16,17,20,21,23,25,26,27,28,29,33...
Your Task:
Write a program or function that, when given an integer i
as input, returns/outputs the i
th SBP.
Input:
An integer i
where 0 <= i < 1,000,000
.
Output:
The i
th SBP.
Test Cases:
12 -> 29
18 -> 41
Scoring:
This is code-golf, lowest score in bytes wins!
i = 999,999
? \$\endgroup\$