Write a function to find pairs of primes p and q satisfying the equation
p/(p+1) + (q+1)/q = 2n/(n+2)
where n is an integer. The function should take a number x as input and produce the triples p, q, and n such that p <= x. If there are no solutions, the function should return three empty vectors.
This problem is adapted from one in the 2012 European Girls’ Math Olympiad.

Solution Stats

21 Solutions

7 Solvers

Last Solution submitted on Dec 14, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers7

Suggested Problems

More from this Author321

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!