Problem 3012. Self-similarity 3 - Every other pair of terms
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 other pair of terms. The problem set assumes that you start with the first element pair and then take every other element pair thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.
For example,
- seq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3]
- seq_every_other_pair = [0, 1, , , 1, 2, , , 1, 2, , , 2, 3, , , 1, 2, , ] (extra commas are instructional and should not be in the every-other series)
- seq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2]
Since seq_every_other_pair = seq_orig_first_half, the set is self-similar.
This problem is related to Problem 3010 and Problem 3011.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers46
Suggested Problems
-
Return the largest number that is adjacent to a zero
5293 Solvers
-
Number of 1s in a binary string
8563 Solvers
-
Getting the indices from a matrix
631 Solvers
-
Create an index-powered vector
716 Solvers
-
Find out the Gray Code for a Given Binary Number
102 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!