Lowest Power Function

73 Views Asked by At

The order of magnitude of a number in base $b$ is given by the function $o_b(x)=\left\lfloor\log_b(x)\right\rfloor$. For example, $o_{10}(481)=2$ since the highest power term needed to express $481$ in decimal is the $10^2$ term.

Is there a function that gives the lowest power required to wholly express a number in a certain base? For example, $l_{10}(7390)=1$ and $l_{2}(0.375)=-3$.

1

There are 1 best solutions below

0
On

You are looking for this function:

https://en.wikipedia.org/wiki/P-adic_order
https://encyclopediaofmath.org/wiki/P-adic_valuation
https://www.wolframalpha.com/input/?i=10-adic+valuation+of+32400

There is not a 'nice' way to write it, but can be coded easily and is usually included in libraries related to number theory.
You can define it for non-primes too, $$v_{10}(x) = \min\left(v_2(x),v_5(x)\right)$$ but you would lose some other properties.