Problem 2672. Largest Geometric Series
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
Jean-Marie Sainthillier
on 18 Dec 2015
Interesting problem but tests are too tricky.
Rafael S.T. Vieira
on 16 Aug 2020
I am not sure that a list of equal numbers qualifies as a series. Would it be a geometric or an arithmetic series?
Lincoln Poon
on 17 Feb 2021
'Randperm' is making this question a whole lot harder...
Solution Comments
Show commentsGroup

Number Manipulation II
- 15 Problems
- 47 Finishers
- Mysterious digits operation (easy)
- Big numbers, repeated least significant digits
- Bit calculation
- Power Times (of the day)
- Equation Times (of the day)
- Consecutive Equation Times (of the day)
- Find out the Gray Code for a Given Binary Number
- Convert to Binary Coded Decimal
- Binary Neighbourhood
- Digital Neighbourhood
- There are 10 types of people in the world
- Big numbers, least significant digits
- Big numbers, repeated least significant digits
- De-primed
- Evened up (or not)
- With apologies to William Blake
Problem Recent Solvers105
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!