Problem 59861. List the ways to write 1/n as the sum of two unit fractions
Cody Problem 59841 involved counting the ways that
can be written as the sum of two unit fractions (those with a numerator of 1). For example, the number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90.
Write a function to list the ways
can be written as the sum of two unit fractions. The output should be a two-column matrix of the denominator pairs with the smaller denominator in the first column and the larger in the second. The values in the first column should be sorted in increasing order. For example, if n = 9, then the output should be [10 90; 12 36; 18 18].
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Project Euler: Problem 3, Largest prime factor
1595 Solvers
-
Return unique values without sorting
935 Solvers
-
Compute a dot product of two vectors x and y
1000 Solvers
-
Create a vector whose elements depend on the previous element
712 Solvers
-
Mysterious digits operation (easy)
293 Solvers
More from this Author291
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!