This repo contains an algorithm using a sieve in order to compute
This algorithm uses the formula
The time complexity of such an algorithm is around
python phi.py <LIMIT>
where LIMIT
is a positive integer with default value 100,000. It will save the values to a file named phi_values_<LIMIT>.txt
.
I did some test to compare it to two others algorithm, the naive one and one using prime factors.
The naive one consist to count how many numbers
The prime factor algorithm uses the same formula
The time measurement were done on a i7-6700 CPU with 32 GB of RAM with Python 3.11. For every
The functions