Generate Golomb's sequence up to the given number.

If n=4, then

seq = [1, 2, 2, 3, 3, 4, 4, 4]

If n=6, then

seq = [1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6]

Solution Stats

31 Solutions

19 Solvers

Last Solution submitted on May 30, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers19

Suggested Problems

More from this Author174

Problem Tags

Community Treasure Hunt

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

Start Hunting!