Problem 59871. List the segmented numbers

The sequence of segmented numbers begins 1, 2, 4, 5, 8, 10, 14, 15, 16. Notice that none of the terms is the sum of consecutive previous terms. The number 3 is not in the sequence between it is 1+2; 11 is not in the sequence because it is 2+4+5, and 12 is not in the sequence because it is 1+2+4+5.
Write a function that returns the nth segmented number.
--------------------
I now realize that this problem is similar to Cody Problem 42832 by HH. That one involves restrictions on the number of terms in the sum, whereas this one asks for larger values of n.

Solution Stats

75.0% Correct | 25.0% Incorrect
Last Solution submitted on Oct 16, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author280

Community Treasure Hunt

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

Start Hunting!