Cody

# Problem 44904. Pascal's Equilateral triangle inside a Matrix!!!

Solution 2216894

Submitted on 17 Apr 2020 by Asif Newaz
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 = 3; y_correct = [0 0 1 0 0 0 1 0 1 0 1 0 2 0 1]; assert(isequal(your_fcn_name(x),y_correct))

c = 1 d = 0 e = 1 0 f = 1 0 g = 1 c = 1 1 d = 0 0 e = 1 1 0 0 f = 1 0 1 0 g = 1 0 1 c = 1 2 1 d = 0 0 0 e = 1 2 1 0 0 0 f = 1 0 2 0 1 0 g = 1 0 2 0 1

2   Pass
x = 5; y_correct = [0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 2 0 1 0 0 0 1 0 3 0 3 0 1 0 1 0 4 0 6 0 4 0 1]; assert(isequal(your_fcn_name(x),y_correct))

c = 1 d = 0 e = 1 0 f = 1 0 g = 1 c = 1 1 d = 0 0 e = 1 1 0 0 f = 1 0 1 0 g = 1 0 1 c = 1 2 1 d = 0 0 0 e = 1 2 1 0 0 0 f = 1 0 2 0 1 0 g = 1 0 2 0 1 c = 1 3 3 1 d = 0 0 0 0 e = 1 3 3 1 0 0 0 0 f = 1 0 3 0 3 0 1 0 g = 1 0 3 0 3 0 1 c = 1 4 6 4 1 d = 0 0 0 0 0 e = 1 4 6 4 1 0 0 0 0 0 f = 1 0 4 0 6 0 4 0 1 0 g = 1 0 4 0 6 0 4 0 1

3   Pass
x = 7; y_correct = [0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 0 0 0 0 0 0 1 0 3 0 3 0 1 0 0 0 0 0 1 0 4 0 6 0 4 0 1 0 0 0 1 0 5 0 10 0 10 0 5 0 1 0 1 0 6 0 15 0 20 0 15 0 6 0 1]; assert(isequal(your_fcn_name(x),y_correct))

c = 1 d = 0 e = 1 0 f = 1 0 g = 1 c = 1 1 d = 0 0 e = 1 1 0 0 f = 1 0 1 0 g = 1 0 1 c = 1 2 1 d = 0 0 0 e = 1 2 1 0 0 0 f = 1 0 2 0 1 0 g = 1 0 2 0 1 c = 1 3 3 1 d = 0 0 0 0 e = 1 3 3 1 0 0 0 0 f = 1 0 3 0 3 0 1 0 g = 1 0 3 0 3 0 1 c = 1 4 6 4 1 d = 0 0 0 0 0 e = 1 4 6 4 1 0 0 0 0 0 f = 1 0 4 0 6 0 4 0 1 0 g = 1 0 4 0 6 0 4 0 1 c = 1 5 10 10 5 1 d = 0 0 0 0 0 0 e = 1 5 10 10 5 1 0 0 0 0 0 0 f = 1 0 5 0 10 0 10 0 5 0 1 0 g = 1 0 5 0 10 0 10 0 5 0 1 c = 1 6 15 20 15 6 1 d = 0 0 0 0 0 0 0 e = 1 6 15 20 15 6 1 0 0 0 0 0 0 0 f = 1 0 6 0 15 0 20 0 15 0 6 0 1 0 g = 1 0 6 0 15 0 20 0 15 0 6 0 1