Problem 42836. Juggler sequence revisited

  • Created by HH

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).


x = 3

l = 6

h = 36

Solution Stats

80.95% Correct | 19.05% Incorrect
Last Solution submitted on Mar 13, 2020

Problem Recent Solvers16

Suggested Problems

More from this Author34

Problem Tags