Number Base Palindrome - A possible New Problem

Back to General discussions forum

CSFPython     2023-08-25 07:47:31

This is an opportunity to look at palindromes in a variety of different number bases.

Rodion (admin)     2023-08-25 09:08:15
User avatar

Clive, thanks a lot! It came just in time - and as usually is of "plug-and-play" type - working as soon as added to the site :) Also it definitely gives motivation to think of deeper numeric problems. Particularly I again started to think about minimum base 2 and existence of base-1 system (in which every number would be palindrome). While not surprisingly some other people thought of this (wikipedia article) there seem to be some discrepancy in definition. Surely base-N system can't use N as digit, but with unary system the only other choice is 0 and it feels like not useful to building any non-zero numbers...

ecolog_veteran     2023-08-25 09:35:41
User avatar

Why has this problem got number 368 when there is no problem 367?

stannyrusota     2023-08-26 07:06:02

Hello family

Sorry but I think something is not right with the checker. Starting with the test data 3701-base 17 is 121312 (not palindrome)but I think the answer should be 15[3701-base 15 = 11611 (palindrome)]

When I tried using my problem's inputs, these are some of the other numbers which I think didn't have the right answer from the checker:

(Data)167 (Checker's base)=166 (My answer)=12{167-base 12 = 1111(palindrome and 12 < 166)}

(Data)6300 (Checker's base)=29{6300-b29 = 7147(not palindrome)} (My answer)=90{6300-b90 = 070(palindrome)}

Am I missing something from the question or is there an issue with the checker?

CSFPython     2023-08-26 08:34:05

stannyrusota, Hi. Taking the test data example of 3701, we have 3701 = 12 - 13 - 12 in base 17. This is a 3-digit number where the 3 digits have numeric values of 12, 13 and 12 respectively. If you were to do arithmetic in base 17 you would probably want to replace these numbers by appropriate symbols. The usual choice is a = 10, b = 11, c = 12, d= 13, e = 14 etc. So we can then write 3701 = cdc in base 17. This is clearly a palindrome. When we use base 15 we get 3701 = 1 - 1 - 6 - 11 or 3701 = 116b in base 15, which is clearly not a palindrome. You need to stop confusing single digits with their numerical value in base 10. I hope this helps.

stannyrusota     2023-08-27 08:02:47

Thank you CSFPython.. You've helped me notice my mistake

I have corrected my code and I have it right

sam_bandara     2023-08-31 03:21:21

Hello Legends,

Answer for 260179844961 is 14739 (one wrong attempt :-) ). I wonder how we calculte to base 14739? Any mathematical method for it? Can somebody please explain?

Cheers, Sam.

gardengnome     2023-09-01 14:09:40
User avatar

Hi Sam,

If you google for number base (conversion), you'll find plenty of material. Here is one: Number System Conversion.

sam_bandara     2023-09-04 00:22:37

Thanks Gardengnome!!!

But, when it comes to bases above 10, there should be an unique character to represent as an example like , A,B,C, etc. Since we have 256 ASCII codes, how do we define the number base above 256? How do we define the numbering alhabet?

Thanks, Sam.

Edit: As CSFPython replied to stannyrusota
gardengnome     2023-09-04 00:28:47
User avatar

The only limit is your imagination. You can make up any symbols that you like really, all that matters is that base n requires n different symbols.

But for this task you don't really have to create or use those symbols. You can for instance represent a number in base 1000 as (999, 0, 333, 77) - this represents a 4 digit number in base 1000, the first digit has the decimal value 999 (the largest possible digit in base 1000), the second digit has the decimal value 0, and so on.

sam_bandara     2023-09-04 03:24:44

Thanks Gardengnome!!! Just done and dusted !!!

Please login and solve 5 problems to be able to post at forum