Did you know that ?

There exist an amazing Prime Family whose each member when reversed is again a prime number. (eg: 13 and 31 both are prime)

Now, let me know that "What is so special about the t o t a l total n u m b e r number of such Prime members greater than 5 5 and less than 2016 2016 ?"

Well... It's also a member of that family..! Believe me !

Task: Can you find out what the n u m b e r number is ?


this problem is a part of set Prime Crimes via Computer Science
113 131 313 191 311 181 373

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.

3 solutions

I am assuming that such primes are not one digit. Then, here is my code: (python 3)

def isPrime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False

    return True

def isprimefamily(n):
    if isPrime(n) and isPrime(int(str(n)[::-1])):
        return True
    else:
        return False

ans=0
for i in range(10,2016):
    if isprimefamily(i):
        ans+=1
    else:
        pass
print (ans)
Vijay Kumar
Jan 23, 2016

Yup. Its true that that number also belongs to that family. [113]

:D Yes.. The problem, when i thought of it before, did not contain that amazing fact. But when I came to the result [113] I was astonished ... then I included the fact in my statement :)

Zeeshan Ali - 5 years, 4 months ago
Zeeshan Ali
Jan 23, 2016

Here is a C++ code to find whether a number is prime or not.

1
2
3
4
5
6
7
8
    bool is_prime(int N){
        for (int i=2; i<N/2; i++){
            if (N%i==0){
                return false;
            }
        }
        return true;
    }

I leave the further work on you all, if you don't mind :)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...