Question: Please do the following in Python 3. Please comment your code so that I understand what is going on. A palindrome is a string that

Please do the following in Python 3. Please comment your code so that I understand what is going on.

Please do the following in Python 3. Please comment your code so

A palindrome is a string that reads the same forwards and backwards. We will call a num- ber octaldrome if its octal representation is a palindrome. So 945 is an octaldrome as in oc- tal it is 1661. The first nine positive octaldromes are 1, 2, 3, 4, 5, 6, 7, 9 and 18. We want to find the n'th positive octaldrome. For example the 1'st positive octaldrome is 1, the fifth pos- itive octaldrome is 5 and the eighth positive octaldrome is 9. Write a function nth_octal- drome(n) that returns the n'th positive octaldrome. So we have nth_octaldrome(1) 1 nth_octaldrome(9) 18

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!