The first test case is wrong 0 and 21 are triangular numbers too (https://oeis.org/A000217), therefore:
multi_triangular(21)
[ 0, 6;
21, 15]
PS: And 0 does not make a pair with every number in this case.
1896 Solvers
Back to basics 12 - Input Arguments
528 Solvers
Calculate the area of a triangle between three points
1015 Solvers
Return a list sorted by number of consecutive occurrences
206 Solvers
388 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!