Problem 291. Triangle Numbers Below N

This is an offshoot of Cody Problem 5: Triangle Numbers.

Triangle numbers are the sums of successive integers. So 6 is a triangle number because

 6 = 1 + 2 + 3

which can be displayed in a triangular shape like so

     * *
    * * * 

Return all triangle numbers below N.

Solution Stats

36.65% Correct | 63.35% Incorrect
Last solution submitted on Sep 20, 2017
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!