Problem 54755. List odd twin composites
Twin primes, or prime numbers that differ by 2 (e.g., 17 and 19, 59 and 61, or 191 and 193), are the subject of several Cody problems: 248, 1096, 3016, and 52298. (See also Cody Problem 53740 for “almost twin primes”.)
This problem deals with twin composites. Because all even numbers are twin composites, let’s focus on odd twin composites, such as 25 and 27, 63 and 65, and 169 and 171.
Write a function that takes a number and produces a two-column matrix with the smaller number of the odd twin composite pair in the first column and the larger in the second column.
Optional exercises: (a) prove that the number of odd twin composites is infinite, (b) prove that the number of twin primes is infinite.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Remove the polynomials that have positive real elements of their roots.
1669 Solvers
-
How to find the position of an element in a vector without using the find function
2710 Solvers
-
Back to basics 9 - Indexed References
439 Solvers
-
Put two time series onto the same time basis
322 Solvers
-
13069 Solvers
More from this Author271
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!