## Minimal Palindromic Base

### August 5, 2014

We have a simple little problem today: Given an integer n > 2, find the minimum b > 1 for which n base b is a palindrome. For instance, n = 15 = 11112 = 1203 = 334 = 305 = 236 = 217 = 178 = 169 = 1510 = 1411 = 1312 = 1213 = 1114; of those, bases 2, 4 and 14 form palindromes, and the least of those is 2, so the correct answer is 2.

Your task is to write a program that calculates the smallest base for which a number n is a palindrome. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Pages: 1 2
{"ft_lang_label":"__label__en","ft_lang_prob":0.90346044,"math_prob":0.99213284,"size":628,"snap":"2022-05-2022-21","text_gpt3_token_len":188,"char_repetition_ratio":0.099358976,"word_repetition_ratio":0.0,"special_character_ratio":0.3598726,"punctuation_ratio":0.11278196,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99879986,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-22T16:02:29Z\",\"WARC-Record-ID\":\"<urn:uuid:1bded8d9-56df-433a-be18-268f1ac9be74>\",\"Content-Length\":\"81699\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:305ebf54-713b-426a-85a3-7959117300fe>\",\"WARC-Concurrent-To\":\"<urn:uuid:ba7a2921-c599-4008-bcd2-6e3455cc1cee>\",\"WARC-IP-Address\":\"192.0.78.25\",\"WARC-Target-URI\":\"https://programmingpraxis.com/2014/08/05/\",\"WARC-Payload-Digest\":\"sha1:EXTGUV2LESN3YMTLUGI7D6S7WHA7HMQI\",\"WARC-Block-Digest\":\"sha1:2OXGG4ULDIHUKPT5J3X452FP5RKWC544\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662545875.39_warc_CC-MAIN-20220522160113-20220522190113-00513.warc.gz\"}"}