Skip to main content
1 of 4

Is it a doubling sequence?

A doubling sequence is an array of numbers where each subsequent number is at least twice the previous number.

Given a pre-sorted list of numbers, determine if the numbers in the list (\$n_{x}\$) have the property that:

\$n_1 \times 2 <= n_2\$

\$n_2 \times 2 <= n_3\ ...\$

and so on until reaching the end of the list.

#Input

A list of numbers.

#Output

Any distinct True or False value.

#Examples:

[10,20,30] > False [10,20,40] > True [1,2,3] > False [1,2,4] > True [1,2,10] > True [1,1] > False [10,1] > False