Borrowing the idea from Pascal Triangle, the following operation can be performed. Starting with an array of numbers from 1 to N (where N is greater than 1), the following upside-down triangle of numbers can be formed where starting from the second row, the number is determined by adding the two neighboring numbers in the previous row.
Given N, determine the sum of all numbers in the triangle.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers25
Suggested Problems
-
Return the 3n+1 sequence for n
8491 Solvers
-
Determine Whether an array is empty
811 Solvers
-
Longest run of consecutive numbers
6476 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
884 Solvers
-
Celsius to Fahrenheit converter
666 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think the description may be more appropriate to say the 'sum of all the numbers in the triangle'.
Problem statement updated.