Determine if a Given Number is a Triangle Number - MATLAB Cody - MATLAB Central

Problem 139. Determine if a Given Number is a Triangle Number

Difficulty:Rate

Description:

Determine if the elements of an input array are triangle numbers and return the result as an array with the same dimensions as the input.

Example:

    Input  = [ 1 2 3 ];
    Output = [ 1 0 1 ];

Solution Stats

36.51% Correct | 63.49% Incorrect
Last Solution submitted on Sep 18, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers386

Suggested Problems

More from this Author56

Problem Tags

Community Treasure Hunt

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

Start Hunting!