Problem 60976. List the complementary / symetric prime couples

Problem statement
For a given positive integer n, provide the prime couples (p,p') such that p + p' = 10^n.
NB : a number like 5 which is its own complementary to 10 is accepted as a couple : (5,5), but no duplicata should be in the list.
Examples (check the test suite for more)
  • n = 1 => p = [3, 7; 5, 5];
  • n = 2 => p = [3, 97; 11, 89; 17, 83; 29, 71; 41, 59; 47, 53];
Forbidden functions / expressions
  • regexp
  • assignin
  • str2num
  • echo
See also

Solution Stats

72.22% Correct | 27.78% Incorrect
Last Solution submitted on Sep 21, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers13

Suggested Problems

More from this Author42

Community Treasure Hunt

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

Start Hunting!