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

New to MATLAB?

Problem 291. Triangle Numbers Below N

Created by @bmtran

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.


Problem Group

Solution Statistics

132 correct solutions 122 incorrect solutions
Last solution submitted on Jul 20, 2015