Let's say you want to know how you might represent all the multiples of the number as a fraction of all natural numbers. You simply observe that the multiples of the number "cover" only half of all natural numbers, and conclude that this number is simply .
You wonder if instead of being given only the number , you would have been given the numbers and were asked the same question what would the answer be? you try the same approach as before, all the multiples of cover of all numbers, and all the multiples of cover of all numbers. so is the answers simply ?
You can see by creating a simple table that you only need to check all the numbers up to because the multiples of and create a unique pattern of size that constantly repeats itself. Another way to look at it is to see that after all the numbers you would get would be simple multiplications of the numbers you already got, and as such would not add any further information, but would keep the ratio of covered numbers to non-covered numbers.
So you create a simple table of all the numbers up to to test your hypothesis and check if this is indeed the answer.
|multiples of 2||2||4||6|
|multiples of 3||3||6|
|multiples of both||2||3||4||6|
and you notice that contradictory to what you expected, only of the numbers ended up covered, and you can already see where you made the mistake, you marked twice. so you update your answer to be
You try taking it a bit further and ask what would the answer be if you would have been given ? learning from past experience you confidently say that the answer must be but just to be sure you make up another table just like before up to
|multiples of 2||2||4||6||8||10||12||14||16||18||20||22||24||26||28||30|
|multiples of 3||3||6||9||12||15||18||21||24||27||30|
|multiples of 5||5||10||15||20||25||30|
|multiples of all||2||3||4||5||6||8||9||10||12||14||15||16||18||20||21||22||24||25||26||27||28||30|
But you notice that 22 numbers are covered and not 21 as you predicted. You soon notice that the only number which stand out from the bunch is the number and you notice that while it was marked 3 times at the start, you also took it down 3 times by unmarking it 3 times with leaving it with 0 markings even thought it is by all means a multiple of (2,3,5). So the correct equation is
But you don't think this is enough and want to generalize your equation so that it would fit any sequence of primes you could throw on it.
You start by laying out all the equations you already have:
For you have
For you have
And for you have
It seems pretty obvious.
Given a set of primes , you simply add all number which has as their numerator and as their denominator.
Then you subtract from the resulting sum by the sum of all the numbers which has as their numerator and a permutation of size of the set as their denominator.
Then you add to the resulting sum the sum of all the numbers which has as their numerator and a permutation of size of the set as their denominator.
And so on until you reach a permutation of size , at which point if is even you subtract and if it's odd, you add it.
A more formal way of putting it is
Given a set of primes , the corresponding equation would be
This equation can be rearranged as
the sum of all products of all permutations of size of S
Confident in your equation you write a simple program that would calculate this equation value for you , and give you trusty computer a order to run it on the set of the first 500 primes. Your computer seems to keep working and working on it, but days on it still hasn't found a solution! checking to see if you got something wrong you remember that the equation for k-permutations of n is and you soon realize that due to the enormous nature of the numbers you get, in order to solve this equation your computer has to run for many times the age of the universe in order to calculate the answer even for the first 500 primes!
So what would you do next?
Well from here on I'll guide you on how to reach to a solution that has a computational efficiency of instead of
I challenge you to solve it for yourself, this problem is not as easy as it looks at first sight, and not as hard as it looks at second sight )
update: posted the answer to the list containing the first 500 primes. If you managed to reach the answer yourself congrats! The Answer