Take any number $$n \in \mathbb{N}$$. Multiply all its digits together. Keep repeating this procedure with the obtained product, until it reaches a single digit. The number of steps required to do this is called the persistence of the number $$n$$ and the final digit obtained is called the digital root of $$n$$.
For instance, starting from 327, the product of the digits is $$3 \times 2 \times 7 = 42$$. Then recurring with 42 the product of the digits is $$4 \times 2 = 8$$, which stops the procedure. The sequence $$327 \longrightarrow 42 \longrightarrow 8$$ finished in two steps, so the number 327 has persistence 2 and digital root 8.
The current record holder is 277777788888899 with a persistence of 11. It is conjectured that there is no number with persistence greater than 11. Supercomputer power has been used to check that this is the case for all numbers up to $$10^{400}$$.
Write a function multiplication that takes an integer $$n \in \mathbb{N}$$ (int). The function must return the product (int) obtained by multiplying all digits of $$n$$ together.
Write a function digital_root that takes an integer $$n \in \mathbb{N}$$ (int). The function must return the digital root (int) of $$n$$.
Write a function persistence that takes an integer $$n \in \mathbb{N}$$ (int). The function must return the persistence (int) of $$n$$.
Write a function most_persistent that takes two integers $$a, b \in \mathbb{N}$$ (int), with $$a \leq b$$. The function must return the number from the interval $$[a, b]$$ with the greatest persistence. If there are multiple numbers from the interval $$[a, b]$$ that reach the greatest persistence, the smallest of these numbers must be returned.
>>> multiplication(327)
42
>>> multiplication(42)
8
>>> multiplication(277777788888899)
4996238671872
>>> digital_root(327)
8
>>> digital_root(68889)
0
>>> digital_root(277777788888899)
0
>>> persistence(327)
2
>>> persistence(8)
0
>>> persistence(277777788888899)
11
>>> most_persistent(1, 100)
77
>>> most_persistent(100, 1000)
679
>>> most_persistent(1000, 10000)
6788
>>> most_persistent(277777788888000, 277777788889000)
277777788888899