Question: MATLAB QUESTION: Write a function called hw4_problem3 that takes k, a positive integer scalar as an input (you do not need to check this). The
MATLAB QUESTION:

Write a function called hw4_problem3 that takes k, a positive integer scalar as an input (you do not need to check this). The function returns p, the smallest prime number smaller than 1000 such that p+k is also prime. If no such prime exists, the function returns 0. You may use the built-in functions primes and/or isprime
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
