Problem 2801. geometric progression
I've modified my previous program so that it now generates geometric progressions. For some reason, there's still always one wrong term. I'll blame it on my computer memory, it can't be my programming.
Once again, can you tell me the position of the wrong term, and return the correct sequence?
For example, given
errorsequence = [2 6 18 25 162]; %geometric sequence starting at 2 with ratio of 3
then
errorposition = 4; truesequence = [2 6 18 54 162];
Note: The progression starts and ratio are integer only, so the sequence you return is expected to be made up of integers only.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers101
Suggested Problems
-
1325 Solvers
-
The Hitchhiker's Guide to MATLAB
3251 Solvers
-
Project Euler: Problem 10, Sum of Primes
1642 Solvers
-
546 Solvers
-
8049 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!