# Extravagant number

In number theory, an extravagant number (also known as a wasteful number) is a natural number in a given number base that has fewer digits than the number of digits in its prime factorization in the given number base (including exponents). For example, in base 10, 4 = 22, 6 = 2×3, 8 = 23, and 9 = 32 are extravagant numbers (sequence A046760 in the OEIS). There are infinitely many extravagant numbers in every base.

## Mathematical definition

Let $\displaystyle{ b \gt 1 }$ be a number base, and let $\displaystyle{ K_b(n) = \lfloor \log_{b}{n} \rfloor + 1 }$ be the number of digits in a natural number $\displaystyle{ n }$ for base $\displaystyle{ b }$. A natural number $\displaystyle{ n }$ has the prime factorisation

$\displaystyle{ n = \prod_{\stackrel{p \,\mid\, n}{p\text{ prime}}} p^{v_p(n)} }$

where $\displaystyle{ v_p(n) }$ is the p-adic valuation of $\displaystyle{ n }$, and $\displaystyle{ n }$ is an extravagant number in base $\displaystyle{ b }$ if

$\displaystyle{ K_b(n) \lt \sum_{{\stackrel{p \,\mid\, n}{p\text{ prime}}}} K_b(p) + \sum_{{\stackrel{p^2 \,\mid\, n}{p\text{ prime}}}} K_b(v_p(n)). }$