Problem 3011. Self-similarity 2 - Every third term
Self-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the OEIS page for more information.
In this problem, you are to check if the sequence is self-similar by every third term. The problem set assumes that you start with the first element and then take every third element thereafter of the original sequence, and compare that result to the first third of the original sequence. The function should return true if the extracted sequence is equal to the first third of the original sequence.
For example,
- seq_original_set = [0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4]
- seq_every_third = [0, , , 1, , , 2, , , 1, , , 2, , ,] (extra commas are instructional and should not be in the every-other series)
- seq_orig_first_third = [0, 1, 2, 1, 2]
Since seq_every_third = seq_orig_first_third, the set is self-similar.
This problem is related to Problem 3010 and Problem 3012.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers62
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52469 Solvers
-
Find the numeric mean of the prime numbers in a matrix.
9118 Solvers
-
Back to basics 21 - Matrix replicating
1778 Solvers
-
Combinations without using nchoosek
135 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
249 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!