Quantcast
Channel: Smaller-Base Palindromes - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 8

Smaller-Base Palindromes

$
0
0

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 ith SBP.

Input:

An integer i where 0 <= i < 1,000,000.

Output:

The ith SBP.

Test Cases:

12 -> 2918 -> 41

Scoring:

This is , lowest score in bytes wins!


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images