Squarefree Factors

Consider the number $54$.
$54$ can be factored in $7$ distinct ways into one or more factors larger than $1$:
$54$, $2 \times 27$, $3 \times 18$, $6 \times 9$, $3 \times 3 \times 6$, $2 \times 3 \times 9$ and $2 \times 3 \times 3 \times 3$.
If we require that the factors are all squarefree only two ways remain: $3 \times 3 \times 6$ and $2 \times 3 \times 3 \times 3$.

Let’s call $\operatorname{Fsf}(n)$ the number of ways $n$ can be factored into one or more squarefree factors larger than $1$, so

Let $S(n)$ be $\sum \operatorname{Fsf}(k)$ for $k=2$ to $n$.


Find $S(10\,000\,000\,000)$.

This problem is related to partitions, a concept in number theory. In this case, you are essentially being asked to partition each number from 2 to \$n\$, into square-free factors, and then sum up the counts.

However, doing this via brute force for \$n = 10,000,000,000\$ is computationally not viable in a reasonable amount of time.

But since this is a combinatoric problem, we can find a general formula for any \$n\$. The formula is a modification of the one used to count the number of partitions of a number into distinct parts:
\operatorname{Fsf}(n) = 2^{\omega(n)}
Here, \$\omega(n)\$ is the number of distinct prime factors of \$n\$. In the factorization of \$n\$, every factor can occur in or not occur in a partition, hence there are \$2\$ possibilities for each factor, which gives the total number of partitions as \$2^{\omega(n)}\$.

For example, let’s calculate \$\operatorname{Fsf}(54)\$. The number \$54\$ has prime factorization \$2 \times 3^3\$, so it has \$2\$ distinct prime factors, i.e., \$2\$ and \$3\$. Therefore, \$\operatorname{Fsf}(54) = 2^2 = 4\$.

However, this does not avoid double-counting partitions that include non square-free numbers. To remove these, we subtract the squarefull divisor function \$\operatorname{sq}(n)\$, resulting in:
\operatorname{Fsf}(n) = 2^{\omega(n)} – \operatorname{sq}(n)
Then, \$S(n)\$ is simply a summation:
S(n) = \sum_{k=2}^n \operatorname{Fsf}(k)
This calculation cannot be done manually, and one should use an advanced software for mathematics or a programming language to do this.

Keep in mind that this derivation is relying on number theory and combinatorics and the above formulas can’t be derived without understanding these concepts deeply.

More Answers:
Hilbert’s New Hotel
Scary Sphere
Subsequence of Thue-Morse Sequence

Error 403 The request cannot be completed because you have exceeded your quota. : quotaExceeded


Recent Posts

Don't Miss Out! Sign Up Now!

Sign up now to get started for free!