Cody

Problem 44732. Highly divisible triangular number (inspired by Project Euler 12)

Solution 3380758

Submitted on 25 Oct 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   Pass
assessFunctionAbsence({'regexp', 'regexpi', 'str2num'},'FileName','div_tri_n.m')

2   Fail
assert(isequal(div_tri_n(2),6))

y = 3

Assertion failed.

3   Fail
assert(isequal(div_tri_n(4),28))

y = 10

Assertion failed.

4   Pass
assert(isequal(div_tri_n(8),36))

y = 36

5   Fail
assert(isequal(div_tri_n(10),120))

y = 55

Assertion failed.

6   Fail
assert(isequal(div_tri_n(20),630))

y = 210

Assertion failed.

7   Fail
assert(isequal(div_tri_n(25),2016))

y = 325

Assertion failed.

8   Fail
assert(isequal(div_tri_n(39),3240))

y = 780

Assertion failed.

9   Fail
assert(isequal(div_tri_n(40),5460))

y = 820

Assertion failed.

10   Fail
assert(isequal(div_tri_n(50),25200))

y = 1275

Assertion failed.

11   Fail
assert(isequal(div_tri_n(70),25200))

y = 2485

Assertion failed.

12   Fail
assert(isequal(div_tri_n(80),25200))

y = 3240

Assertion failed.

13   Fail
assert(isequal(div_tri_n(100),73920))

y = 5050

Assertion failed.

14   Fail
assert(isequal(div_tri_n(115),157080))

y = 6670

Assertion failed.

15   Fail
assert(isequal(div_tri_n(120),157080))

y = 7260

Assertion failed.

16   Fail
assert(isequal(div_tri_n(130),437580))

y = 8515

Assertion failed.

Suggested Problems

More from this Author139

Community Treasure Hunt

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

Start Hunting!