Problem 42835. Return the sequence element II
Given positive integers x and n, return a positive integer, y, which is the nth term in the Juggler sequence beginning with x.
The Juggler sequence is defined by:
a(i+1) = floor(a(i)^0.5) , for even a(i).
a(i+1) = floor(a(i)^1.5) , for odd a(i).
For the purpose of this problem, the first element in the sequence is a(1) = x.
Example:
x = 3
n = 5
y = 6
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers44
Suggested Problems
-
Reverse the elements of an array
1106 Solvers
-
17798 Solvers
-
522 Solvers
-
Divide elements by sum of elements
138 Solvers
-
find "greatest common divisor" of two integer value
198 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!