Problem 52462. Easy Sequences 1: Find the index of an element
The nth element of a series A is defined by:
. Obviously, the first element
. Given the nth element
, find the value of the corresponding index n.
Solution Stats
Problem Comments
-
8 Comments
Show
5 older comments
Dyuman Joshi
on 24 Sep 2021
Because you are not doing what the question is asking
Asif Newaz
on 21 Aug 2022
I think the last test case is wrong
Rafael S.T. Vieira
on 12 Nov 2022
Rahul Gulia, in the last test, there will be numbers greater than 1000. And the last test is not wrong. Just remember that indexes are always positive (I had trouble with that also, we are so focused on the sequence that we forget that indexes can't be negative).
Solution Comments
Show commentsProblem Recent Solvers46
Suggested Problems
-
Find the sum of all the numbers of the input vector
50694 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1200 Solvers
-
Integer sequence - 2 : Kolakoski sequence
169 Solvers
-
Solve a System of Linear Equations
12776 Solvers
-
342 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!