Problem 42833. Return the sequence element I
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
Jean-Marie Sainthillier
on 27 Apr 2016
"...return a positive integer, y, which is the xth term ..." in de description.
Solution Comments
Show commentsProblem Recent Solvers38
Suggested Problems
-
Return the largest number that is adjacent to a zero
5342 Solvers
-
given 3 sides, find area of this triangle
797 Solvers
-
360 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
476 Solvers
-
133 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!