Let's say I have the number 3294830924.
I want to divide it by prime numbers, 2, 3, 5, 7, 11, etc..
And I want to know which operations gives me modulo 0.
something like:
int[] primeNumbers = ...;
var n = 3294830924;
return primeNumbers.Where(pn=> pn < n).Where(pn=> n % pn == 0)
is there any built in function or method to get the list of prime numbers in C# or a way to calculate this in a mathematical fashion?