Given an integer $N$, let $P$ be the set of all primes less than or equal to $\sqrt{N}$ that divide $N$. Define $P_{prod}$ as $\prod_{p \in P} f_N(p)$ where $f_N(p) \gt 1$ is the largest power of $p$ that divides $N$ (i.e. $f_N(p) = p^k$ for some integer $k > 1$ s.t. $p^k \mid N$, but $p^{k+1} \nmid N$. Is it possible to prove that that the quantity $N_{reduced} := \frac{N}{P_{prod}}$ is either:
- $1$ (i.e. when $P_{prod} = N$); or
- is prime
Motivation: I'm working on doing prime factorizations in Desmos. I'm trying to do some optimizations such as only checking $N$'s divisibility against primes less than or equal to $\sqrt{N}$, but running into cases like $N = 1590$ where $\sqrt{N} \approx 39.87$ and $P$, the set of primes less than or equal to $\sqrt{N}$ that divide $N$, is $\{2, 3, 5\}$ and $P_{prod} = 2^1 \cdot 3^1 \cdot 5^1 = 30$ and $N_{reduced} = \frac{N}{P_{prod}} = \frac{1590}{30} = 53$ happens to be prime and so in the case of $N = 1590$, I can write out the whole prime factorization as $\prod_{p \in P} f_N(p) \cdot N_{reduced} = 2^1 \cdot 3^1 \cdot 5^1 \cdot 53^1$, but will that be the case in general? Will it always be the case that either $N_{reduced}$ is either $1$ or prime?
Can someone check this logic?
As a first step, we can notice if $N_{reduced}$ is $1$, then we're done. Otherwise $N_{reduced} > \sqrt{N}$ as if $N_{reduced}$ was $\leq \sqrt{N}$, then it would either be prime and included in $P$, which it wasn't, or $N_{reduced}$ would be a composite product of primes less than $\sqrt{N}$ and it would be possible to reduce $N_{reduced}$ further. So $N_{reduced}$ is either $1$ or $\gt \sqrt{N}$.
Note also that $N_{reduced} \leq N$. If $N_{reduced}$ is not $1$, then $\sqrt{N} < N_{reduced} \leq N$. If $N_{reduced}$ is composite, then it would have to be a composite of primes greater than $\sqrt{N}$ (otherwise, it could be reduced further), but this contradicts $N_{reduced} \leq N$, so $N_{reduced}$ has to be prime.