Problem 57477. Solve an equation involving primes and fractions

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

88.89% Correct | 11.11% Incorrect
Last Solution submitted on Sep 17, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author272

Community Treasure Hunt

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

Start Hunting!