Cody

Problem 44716. Counting Squares

Solution 2913679

Submitted on 5 Sep 2020 by Rafael S.T. Vieira
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
assert(isequal(Square(1),1))

2   Pass
assert(isequal(Square(2),5))

3   Pass
assert(isequal(Square(3),13))

4   Pass
assert(isequal(Square(4),25))

5   Pass
assert(isequal(Square(5),41))

6   Pass
assert(isequal(Square(6),61))

7   Pass
assert(isequal(Square(7),85))

8   Pass
assert(isequal(Square(8),113))

9   Pass
assert(isequal(Square(9),145))

10   Pass
assert(isequal(Square(16),481))

11   Pass
assert(isequal(Square(25),1201))

12   Pass
assert(isequal(Square(49),4705))

13   Pass
assert(isequal(Square(64),8065))

14   Pass
assert(isequal(Square(81),12961))

15   Pass
assert(isequal(Square(100),19801))

16   Pass
assert(isequal(Square(500),499001))

17   Pass
assert(isequal(Square(999),1994005))

Suggested Problems

More from this Author18

Community Treasure Hunt

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

Start Hunting!