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

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Feb 12, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers4

Suggested Problems

More from this Author264

Community Treasure Hunt

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

Start Hunting!