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.
Find the peak 3n+1 sequence value
1122 Solvers
566 Solvers
Back to basics 11 - Max Integer
682 Solvers
How many trades represent all the profit?
526 Solvers
Natural numbers in string form
361 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!