Simple Problem 2

If N N is the 7 1 t h 71^{th} prime number and M M is the 7 7 t h 77^{th} prime number, What is the value of M N M - N


The answer is 36.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Suresha Hd
Aug 6, 2014

The 77th prime number is 389 and 71th is 353. M=389, N=353. M-N=36. So 36 is the answer..!!

include <stdio.h>

main() { int m, n, count=0,i,j=2,f; while(count<=77) { f=0; for(i=2;i<j;i++) { if(j%i==0) { f=1; break; }

   }
    if(f==0)
    {
        count++;
        if(count==71)
        {
            m=j;
        }
        if(count==77)
        {
            n=j;
        }
    }
    j++;

} printf("\n%d",n-m); }

VijayaSatya Kothapalli - 6 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...