1
$\begingroup$

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.

$\endgroup$
2
  • 3
    $\begingroup$ yes, there can be at most one prime factor larger than $\sqrt N,$ if there is one it must be to the first power. $\endgroup$
    – Will Jagy
    Commented Mar 2, 2023 at 1:59
  • $\begingroup$ Sounds so obvious when you say it lol. $\endgroup$
    – joseville
    Commented Mar 2, 2023 at 2:01

1 Answer 1

1
$\begingroup$

A short answer or method follows. Because each factor is paired, once you have a prime factor, use it's paired factor to look for other factors.

Each factor you find, allows you to reduce N to something simpler. In your case of 1590, 10 is a factor. Use $\frac{1590}{10} = 159$ and then scour 159 for other factors.

Explore some tips and tricks, for integer division which will speed this up or enable you to do at least part of it without a calculator.

Finally, it can be helpful to memorize the first few primes. They are 2, 3, 5, 7, 11, 13, 17, 19, 23, ... Especially, 2, 3, 5 and 7.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .