> What is remarkable about this algorithm is, that it uses no divisions at all!
The same holds for the Sieve of Eratosthenes [1]
The same holds for the Sieve of Eratosthenes [1]
I still find it remarkable, that you can avoid divisions, while not to computing all multiples up-front and marking the results in a large table.
Can you express the number in terms of the quotient and remainder?
Using this expression write an algorithm that outputs the quotient and remainder using only addition, multiplication and checking equality with integers.
I think doing this would make the algorithm seem less surprising.
And it uses no divisions.
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Euler.27...