Cody

Problem 1688. Prime Sequences: AP-k Minimum Final Value

Solution 1279014

Submitted on 30 Sep 2017
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
n=4; p=3; [a,b]=APk_min_end(p,n); toc assert(isequal(a+b*prod(primes(p))*n,29))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

2   Fail
n=5; p=5; [a,b]=APk_min_end(p,n); toc assert(isequal(a+b*prod(primes(p))*n,157))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

3   Fail
n=6; k=5; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,907))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

4   Fail
n=7; k=7; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,1669))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

5   Fail
n=8; k=7; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,1879))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

6   Fail
n=9; k=7; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,2089))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

7   Fail
n=10; k=11; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,249037))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

8   Fail
n=11; k=11; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,262897))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

9   Fail
n=12; k=13; [a,b]=APk_min_end(k,n); toc assert(isequal(a+b*prod(primes(k))*n,725663))

Error using min MIN with two matrices to compare and two output arguments is not supported. Error in APk_min_end (line 3) [M,A] = min(max(G)./all(isprime(G)),2);

Suggested Problems

More from this Author241

Community Treasure Hunt

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

Start Hunting!