In a geometric series, ratio of adjacent elements is always a constant value. For example, [2 6 18 54] is a geometric series with a constant adjacent-element ratio of 3.
A vector will be given. Find the largest geometric series that can be formed from the vector.
Example:
input = [2 4 8 16 1000 2000];
output = [2 4 8 16];
Update - Test case added on 21/8/22
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers125
Suggested Problems
-
1713 Solvers
-
Numbers with prime factors 2, 3 and 5.
682 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13627 Solvers
-
Change the sign of even index entries of the reversed vector
643 Solvers
-
Find the index of n in magic(n)
272 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Interesting problem but tests are too tricky.
I am not sure that a list of equal numbers qualifies as a series. Would it be a geometric or an arithmetic series?
'Randperm' is making this question a whole lot harder...