I like to think of a 10-adic number as a number that goes infinitely to the left, or an integer modulo a very very large power of 10.
Things carry infinitely to the left and vanish. To see what I mean, note that ...6667 * 3 = 1
in the 10-adic land, since the "2" that carries to the left goes to infinity.
Addition and multiplication make sense for 10-adic numbers, since the last n
digits of the sum/product only depend on the last n
digits of the summands/multiplicands.
Given n
, you need to print the last n
digits of the 10-adic cube root of 3, i.e. x
satisfiying x*x*x = 3
.
It ends:
...878683312291648481630318492665160423850087895134587
Your code must terminate for n=1000
before submission.
Let's say that if the number you need to print begins with zero, then you don't need to print the leading zeroes, since it isn't actually the point to print extra zeroes.
This is code-golf. Shortest answer in bytes wins.
n=12
outputting87895134587
instead of087895134587
. Personally I would make it optional, since it would invalidate almost all answers.. \$\endgroup\$