Cody

# Problem 45423. Bernoulli's Triangle

Solution 2197460

Submitted on 7 Apr 2020
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
x = [1 0 0 0 0 1 2 0 0 0 1 3 4 0 0 1 4 7 8 0 1 5 11 15 16] assert(isequal(bernoulli_tri(5),x))

x = 1 0 0 0 0 1 2 0 0 0 1 3 4 0 0 1 4 7 8 0 1 5 11 15 16 s = 7 11 16

Output argument "y" (and maybe others) not assigned during call to "bernoulli_tri". Error in Test1 (line 6) assert(isequal(bernoulli_tri(5),x))

2   Fail
x = [1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 1 3 4 0 0 0 0 0 0 0 1 4 7 8 0 0 0 0 0 0 1 5 11 15 16 0 0 0 0 0 1 6 16 26 31 32 0 0 0 0 1 7 22 42 57 63 64 0 0 0 1 8 29 64 99 120 127 128 0 0 1 9 37 93 163 219 247 255 256 0 1 10 46 130 256 382 466 502 511 512] assert(isequal(bernoulli_tri(10),x))

x = 1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 1 3 4 0 0 0 0 0 0 0 1 4 7 8 0 0 0 0 0 0 1 5 11 15 16 0 0 0 0 0 1 6 16 26 31 32 0 0 0 0 1 7 22 42 57 63 64 0 0 0 1 8 29 64 99 120 127 128 0 0 1 9 37 93 163 219 247 255 256 0 1 10 46 130 256 382 466 502 511 512 s = 7 11 16 22 29 37 46 56

Output argument "y" (and maybe others) not assigned during call to "bernoulli_tri". Error in Test2 (line 11) assert(isequal(bernoulli_tri(10),x))

3   Fail
x = [1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1 3 4 0 0 0 0 0 0 0 0 0 0 1 4 7 8 0 0 0 0 0 0 0 0 0 1 5 11 15 16 0 0 0 0 0 0 0 0 1 6 16 26 31 32 0 0 0 0 0 0 0 1 7 22 42 57 63 64 0 0 0 0 0 0 1 8 29 64 99 120 127 128 0 0 0 0 0 1 9 37 93 163 219 247 255 256 0 0 0 0 1 10 46 130 256 382 466 502 511 512 0 0 0 1 11 56 176 386 638 848 968 1013 1023 1024 0 0 1 12 67 232 562 1024 1486 1816 1981 2036 2047 2048 0 1 13 79 299 794 1586 2510 3302 3797 4017 4083 4095 4096] assert(isequal(bernoulli_tri(13),x))

x = 1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1 3 4 0 0 0 0 0 0 0 0 0 0 1 4 7 8 0 0 0 0 0 0 0 0 0 1 5 11 15 16 0 0 0 0 0 0 0 0 1 6 16 26 31 32 0 0 0 0 0 0 0 1 7 22 42 57 63 64 0 0 0 0 0 0 1 8 29 64 99 120 127 128 0 0 0 0 0 1 9 37 93 163 219 247 255 256 0 0 0 0 1 10 46 130 256 382 466 502 511 512 0 0 0 1 11 56 176 386 638 848 968 1013 1023 1024 0 0 1 12 67 232 562 1024 1486 1816 1981 2036 2047 2048 0 1 13 79 299 794 1586 2510 3302 3797 4017 4083 4095 4096 s = 7 11 16 22 29 37 46 56 67 79 92

Output argument "y" (and maybe others) not assigned during call to "bernoulli_tri". Error in Test3 (line 14) assert(isequal(bernoulli_tri(13),x))

### Community Treasure Hunt

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

Start Hunting!