How many primes are less than or equal to 100 by Inclusion Exclusion Rule And by using Mathematica

Let P1=Integers that are less than or equal 100 and divisible by 2

P2=Integers that are less than or equal 100 and divisible by 3

P3=Integers that are less than or equal 100 and divisible by 5

P4=Integers that are less than or equal 100 and divisible by 7

Thus number of primes less than or equal to 100= 4+N(P'1 P'2 P'3 P'4)

N(P'1 P'2 P'3 P'4)= N-N(P1)-N(P2)-N(P3)-N(P4)-N(P1P2)-N(P1P3)-N(P1P4)-N(P2P3)-N(P2P4)-N(P3P4)-N(P1P2P3)-N(P1P2P4)-N(P2P3P4)-N(P1P3P4)-N(P1P2P3P4)


99-1002-1003-1005-1007+1002·3+1002·5+1002·7+1003·5+1003·7+1005·7
-1002·3·5-1002·3·7-1003·5·7-1002·5·7+1002·3·5·7
*(We put 99 because number [1] does not count as a prime number)*

 Of course we should take the floor for these fractions...

Now=99-50-33-20-14+16+10+7+6+4+2-3-2-1-0+0
=21

So , number of primes less than or equal to 100=> 21+4=25

Now by using mathematica...






Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post