Files
Piotr Idzik b9c118fb5d style: remove interaction with the user (#3009)
* style: remove interaction with the user

Helps with #2753

* clang-format and clang-tidy fixes for ff441e08

* tests: add test with result being a zero vector

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-10-11 14:49:11 +00:00
..
2022-02-02 11:02:02 +05:30
2021-10-26 13:19:58 +05:30

Prime factorization

Prime Factorization is a very important and useful technique to factorize any number into its prime factors. It has various applications in the field of number theory.

The method of prime factorization involves two function calls. First: Calculating all the prime number up till a certain range using the standard Sieve of Eratosthenes.

Second: Using the prime numbers to reduce the the given number and thus find all its prime factors.

The complexity of the solution involves approx. O(n logn) in calculating sieve of eratosthenes O(log n) in calculating the prime factors of the number. So in total approx. O(n logn).

Requirements: For compile you need the compiler flag for C++ 11