Problem 42836. Juggler sequence revisited
This problem is related to Problem 42835.
For any starting positive integer, a(1) = 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).
When a Juggler sequence reaches 1, all subsequent elements will also be 1s.
Let l(x) be the number of Juggler sequence iterations required to reach 1 with a starting value of x.
Let h(x) be the maximum value of a Juggler sequence with a starting value of x.
Given x, return l(x) and h(x).
Example:
x = 3
l = 6
h = 36
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers27
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
8690 Solvers
-
Find the peak 3n+1 sequence value
2324 Solvers
-
Check if number exists in vector
10458 Solvers
-
594 Solvers
-
How long do each of the stages of the rocket take to burn?
255 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!