Add up to Even Number with Primes

Published by wangyang2048 in

Create a function that takes an even number (will always be greater than 4) and return a list of all pairs of prime numbers which add up to the given number.

Examples

prime_pair_list(10) ➞ ["3+7", "5+5"]

prime_pair_list(50) ➞ ["3+47", "7+43", "13+37", "19+31"]

prime_pair_list(100) ➞ ["3+97", "11+89", "17+83", "29+71", "41+59", "47+53"]

Notes

N/A

Watch a quick demo on how Edabit works.