+ 6
Double-base palindromic numbers?
If integer number palindrome in the decimal base it looks like: ... Decimal: 585; Decimal: 4554; Decimal: 676... or for binary: ... Binary: 1001; Binary: 11111; Binary: 1011101... If integer number palindromic in two basis it looks like: ... Decimal: 717; Binary: 1011001101; Decimal: 7447; Binary: 1110100010111; Decimal: 9009; Binary: 10001100110001... With help of this code you can search for lot of palindromic numbers. I successfully tested id for first numbers below 10,000,000. https://code.sololearn.com/c25iD0kFCWjS/#cpp
5 Answers
+ 4
Hi Dmytro !
Playing with the good idea you shared here, I came to a funny result with the code I made :
I'm afraid I must share with you that the most palindromic (multi-basely speaking) is none other than :
4369 !
Explanation is on top of the code:
https://code.sololearn.com/cglfB2nHnE2i/#py
+ 4
@Cestpasgrave It is so great that you change task and founded the MOST palindromic number (if I understand right). I will try to repeat after you in the c++ version.
+ 2
nice idea
+ 2
A good practice would be to optimize the algorithm to get faster results.
+ 1
I finally get to do it, like a year late, good idea for practice :D
Can't beat CĂ©pagrave's 64 bases code still, this one checks for possible Palindrome from base 2 to 36 on a given number, or range.
https://code.sololearn.com/ck4ky39xQ4qP/?ref=app