How do I interpret the following mathematically:

Consider a positive integer $n$ such that $n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_m^{\alpha_m}$ where $p_i$ are primes and $\alpha_i$ are positive integers.

I want to consider the positive integer $m\le n$ such that $m$ has the largest number of distinct prime factors among all positive integers less than or equal to $n$.

I explain it with the following example:

Consider $n=36$. Here my $m$ will be $30$ since $30=2\times 3\times 5$ and it has the largest number of distinct prime factors among all positive integers which are less than or equal to $n=36$.

But I cant express my view mathematically. How do I present my mathematical idea? Can someone please help me to write the above fact in a more precise and concise manner which can be easily understood by mathematicians.

Please help.