I am a first-year college undergraduate studying Computer Science, and during my winter break I got bored and decided to try to learn a little bit of computational number theory. However, I quickly got stuck on the first part of Computational Number Theory by Abhijit Das because I can't seem to comprehend how his algorithm could possibly be valid for any integer entered by the user. Here is a chart taken from the book that illustrates his approach step-by-step:
His final answer for the case given is correct, and I understand how he generated the numbers he got at each step, but I feel that either his algorithm only works for a specific domain of numbers, or that I'm misunderstanding how to generalize his approach. My confusion stems from the fact that if I truncated his example down to say, "21", then $(12)_{256}$ is not the base-256 representation of the decimal number 21.
So am I wrong, or is the book wrong?
