If you have a 10-adic integer, and you want to reduce it to a 5-adic integer, then to know its last n digits in base 5, you just need to know what it is modulo 5n. If you know what it is modulo 10n, then you can reduce it module 5n, so you only need to look at the last n digits in base 10 to find its last n digits in base 5. So a base-10 integer ending in …93 becomes a base-5 integer ending in …33, because 93 mod 25 is 18, which, expressed in base 5, is 33.
The Chinese remainder theorem tells us that we can go backwards: given a 5-adic integer and a 2-adic integer, there’s exactly one 10-adic integer that reduces to each of them. Let’s say we want the 10-adic integer that’s 1 in base 5 and −1 in base 2. The last digit is the digit that’s 1 mod 5 and 1 mod 2 (i.e. 1). The last 2 digits are the number from 0 to 99 that’s 1 mod 25 and 3 mod 4 (i.e. 51). The last 3 digits are the number from 0 to 999 that’s 1 mod 125 and 7 mod 8 (i.e. 751). And so on.
If you have a 10-adic integer, and you want to reduce it to a 5-adic integer, then to know its last n digits in base 5, you just need to know what it is modulo 5n. If you know what it is modulo 10n, then you can reduce it module 5n, so you only need to look at the last n digits in base 10 to find its last n digits in base 5. So a base-10 integer ending in …93 becomes a base-5 integer ending in …33, because 93 mod 25 is 18, which, expressed in base 5, is 33.
The Chinese remainder theorem tells us that we can go backwards: given a 5-adic integer and a 2-adic integer, there’s exactly one 10-adic integer that reduces to each of them. Let’s say we want the 10-adic integer that’s 1 in base 5 and −1 in base 2. The last digit is the digit that’s 1 mod 5 and 1 mod 2 (i.e. 1). The last 2 digits are the number from 0 to 99 that’s 1 mod 25 and 3 mod 4 (i.e. 51). The last 3 digits are the number from 0 to 999 that’s 1 mod 125 and 7 mod 8 (i.e. 751). And so on.