Cody

Problem 44675. Find prime number couples

Given a vector a, which will always contain at least one pair of prime numbers couple, return a matrix called 'couple' in which each row contains one pair of prime couples. A prime number couple pair are two prime numbers with a difference of two between them. Keep in mind that the numbers 2, 3, 5, and 7 are prime numbers.

For example, if a=[1 2 3 6 11 13 101 103], the output should be couple=[11 13; 101 103].

Solution Stats

57.69% Correct | 42.31% Incorrect
Last Solution submitted on Mar 07, 2020

Problem Comments

Problem Recent Solvers13

Suggested Problems