Given a positive integer, x, return a positive integer, y, which is the xth term in the sequence [1 2 2 3 3 3...], in which one instance of the number 1 is followed by two instances of the number 2, followed by three instances of the number 3, and so on.
Example 1:
x = 5
y = 3
Example 2:
x = 105
y = 14
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers44
Suggested Problems
-
1247 Solvers
-
How to find the position of an element in a vector without using the find function
2814 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
647 Solvers
-
Multiples of a Number in a Given Range
939 Solvers
-
Find the index of n in magic(n)
272 Solvers
More from this Author45
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
"...return a positive integer, y, which is the xth term ..." in de description.