Problem 44343. Pair Primes
Solution Stats
Problem Comments
-
4 Comments
there are quite a few look-up table solutions, could you perhaps add something like the following to the test suite to discourage these? assert(~any(cellfun(@(x)ismember(max([0,str2num(x)]),[51,2485,136162,8578934]),regexp(fileread('pairPrimes.m'),'[\d\.\+\-\*\/]+','match'))))
Do you consider (13, 31) and (31, 13) as the same or different pair primes? Similarly, how about (79, 97) and (97, 79)?
Thanks for pointing it out. They are different pair primes.
Good problem. At first, I thought we needed to reverse the numbers, but only their order is necessary. And we need to count twice numbers like 31 and 13.
Solution Comments
-
1 Comment
can you do better than this?
Problem Recent Solvers97
Suggested Problems
-
Find the alphabetic word product
2874 Solvers
-
Compute a dot product of two vectors x and y
902 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
168 Solvers
-
Create logical matrix with a specific row and column sums
280 Solvers
-
Pandigital Multiples of 11 (based on Project Euler 491)
47 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!