A Programming Excercise

By Daniel Miessler on October 11th, 2005: Tagged as Programming | Python
  • Ken
    You comments are kinds D, but my code was getting complex fast. I think this is the most elegant solution to the problem.

    BTW I did find one piece on the challenge site that looked like mine in python, but was almost 40 lines when it was done. WAY TO GO DUDE!
  • Carl M
    If I am reading your code correctly, it finds ONE magic number for each of the numbers from 2 to 9. (This is in fact what the instructions required.) But, my question is: Are the answers unique? Extend that question a little bit ...
    for an integer, i, from 1 to 9 (note that I started at 1), how many six digit numbers have the property that they are equal to their digit reversal when multiplied by i? PERHAPS the answer is that there is only one such six digit number for each of the numbers from 2 to 9, but there are certainly MANY when i=1. How many?
blog comments powered by Disqus

 

twitter_icon

Sample Original Content


Information Security

Tutorials and Primers

Culture & Society

Technology & Science

Politics

Philosophy & Religion

Miscellaneous

Tools & Projects


Blog Archives