Cody

# Problem 69. Find the peak 3n+1 sequence value

Solution 1854958

Submitted on 21 Jun 2019
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
nmax = 10; pmax = 52; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test1 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

2   Fail
nmax = 30; pmax = 9232; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test2 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

3   Fail
nmax = 100; pmax = 9232; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test3 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

4   Fail
nmax = 1000; pmax = 250504; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test4 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

5   Fail
nmax = 2000; pmax = 1276936; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test5 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

6   Fail
nmax = 4500; pmax = 6810136; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test6 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

7   Fail
nmax = 8120; pmax = 8153620; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test7 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

8   Fail
nmax = 9998; pmax = 27114424; assert(isequal(peakOfPeaks(nmax),pmax))

Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in peakOfPeaks (line 5) c=[c; n]; Error in Test8 (line 3) assert(isequal(peakOfPeaks(nmax),pmax))

### Community Treasure Hunt

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

Start Hunting!