Cody

# Problem 42581. Create sequnce 1 4 9 16 25.........

Solution 1198923

Submitted on 27 May 2017 by Augusto Mazzei
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   Pass
x = 25; y_correct = [1 4 9 16 25]; assert(isequal(prntseq(x),y_correct))

y = 1 4 9 16 25 36 49 64 81 100 121 144 169 y = 1 4 9 16 25

2   Pass
x = 100; y_correct = [1 4 9 16 25 36 49 64 81 100]; assert(isequal(prntseq(x),y_correct))

y = Columns 1 through 14 1 4 9 16 25 36 49 64 81 100 121 144 169 196 Columns 15 through 28 225 256 289 324 361 400 441 484 529 576 625 676 729 784 Columns 29 through 42 841 900 961 1024 1089 1156 1225 1296 1369 1444 1521 1600 1681 1764 Columns 43 through 50 1849 1936 2025 2116 2209 2304 2401 2500 y = 1 4 9 16 25 36 49 64 81 100

3   Pass
x = 9; y_correct = [1 4 9]; assert(isequal(prntseq(x),y_correct))

y = 1 4 9 16 25 y = 1 4 9

4   Pass
x = 36; y_correct = [1 4 9 16 25 36]; assert(isequal(prntseq(x),y_correct))

y = 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 y = 1 4 9 16 25 36

### Community Treasure Hunt

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

Start Hunting!