Problem statement
The twin prime couples (p,p') are the ones such that p' = p + 2.
For a given integer n > 1, list the twin prime couples less or equal to n.
Present your result in a m x 2 matrix, where m is the number of twin couples.
Examples
  • n = 10 => p = [3, 5; 5, 7];
  • n = 20 => p = [3, 5; 5, 7; 11, 13; 17 19];
  • n = 100 => p = [3, 5; 5, 7; 11, 13; 17 19; 29, 31; 41, 43; 59, 61; 71, 73];
Forbidden functions / expressions
  • regexp
  • assignin
  • str2num
  • echo
See also

Solution Stats

47 Solutions

32 Solvers

Last Solution submitted on Jan 25, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...