Problem 44339. Recaman Sequence - II
Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index.
For example: if n = 0 (default Recaman sequence)
seq = [0 1 3 6 2];
1 is in the second place.
if n = 10;
seq = [10 9 7 4 8 3 9 2 10 1 11 22 34 21];
1 is in the 10th place
Related Challenges :
- Recaman Sequence - I
- Recaman Sequence - II
- Recaman Sequence - III
Solution Stats
Problem Comments
-
2 Comments
Jakub
on 7 Nov 2017
Weirdly, the code that finishes the biggest problem in 0.6 sec on my machine will not finish on the server. Is 0.6 sec too long for the server, or is it an error? I'm not clever enough to understanding this, please help.
Qi Zhang
on 1 Jan 2018
I met the problem too. Should we use some mathematical characters of the sequence to improve our codes? I'm not quite sure.
Solution Comments
Show commentsGroup

Cody5:Easy
- 31 Problems
- 159 Finishers
- Energy of a photon
- Breaking Out of the Matrix
- The Top 5 Primes
- I Plead the Fifth
- Pentagonal Numbers
- Is this is a Tic Tac Toe X Win?
- Inscribed Pentagon?
- Circle/Pentagon Overlap
- Octoberfest festival
- Polarisation
- Missing five
- ASCII Birthday Cake
- Find the nearest prime number
- Extra safe primes
- 5 Prime Numbers
- Is this is a Tic Tac Toe X Win?
- Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
- MATLAB Counter
- Basic electricity in a dry situation
- How to subtract?
- Pernicious Anniversary Problem
- 5 Prime Numbers
- Is it really a 5?
- The glass half full
- Pi Digit Probability
- A Simple Tide Gauge with MATLAB
- Predicting life and death of a memory-less light bulb
- Write c^3 as sum of two squares a^2+b^2
- Van Eck's Sequence's nth member
- Sums of Multiple Pairs of Triangular Numbers
- Recaman Sequence - I
- Recaman Sequence - II
- Spot the First Occurrence of 5
- Energy of a photon
Problem Recent Solvers272
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!