Question: C++ question, please help me. The description is a little bit complicated. But I really hope someone could help me with it. Thank you. The
C++ question, please help me.
The description is a little bit complicated. But I really hope someone could help me with it. Thank you.
The starter of this project is on https://paste.ee/p/R928c




Background We are going to work with programs that can identify "alindromic prime" numbers in various bases Palindrome You all remember palindromes, right? They are sentences that read the same forwards and backwards The same principle can be applied to numbers. A palindromic number is a number whose value is the same read forwards and backwards. In base1o: 123454321, 151, 1. In base2: 101, 111000111, 0. In base16: 123aba321, flf, d Different Base It's obvious that whether a number is palindromic depends on the base that it is expressed in. For example: 17 base10 is not, but expressed as base2, 10001, it is. 170 base10 is not, but expressed in base16, aa, it is. We need to be able to convert to different bases to understand whether a number is palindromic Let's remember how numbers in a different base work. Let's look at hexadecimal (base 16). Look at the number below 163162161160 Each of the svmbols occupies a position in the string, and that position is a power of the base we are working with. Thus, this number represents: (a*163Hb * 16')+(1 * 16"+(0 * 160)=(10 * 4096) + (1 1 * 256)+16+0=43, 792 where the character 'a-10 and 'b'-11, two of the characters a-f, the 6 extra characters past 9 we need to represent base 16 We cannot represent such a number as a long (or any other builtin type) as there is no way to represent the a-f characters. Thus, we often represent such a higher base number with a string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
