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 commentsGroup

Cody Problems in Japanese
- 16 Problems
- 272 Finishers
- ベクトルのスケーリング
- 二つのベクトルの要素ごとの積の平均を計算しよう
- 2倍してみよう - ここからスタート!
- ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
- サイコロを作ろう
- チェッカーボードを作ろう
- ベクトルの値が増加しているかを調べよう
- 二乗になっている数を見つけよう
- 二つのベクトルの要素ごとの積の平均を計算しよう
- 行列内の素数の平均をとろう
- ゼロでない要素が一番多い行を探そう
- 特定の値がベクトル内に含まれているかを確認するコードを書こう
- NaN (欠損値) が含まれている行を削除しよう
- テレビのサイズを求めてみよう
- 英語の文章内の母音を取り除くコードを書きましょう。
- 対称で、n*2n のサイズの行列を作成しましょう
- 文字列の最初と最後の文字だけ抜き出しましょう。
Problem Recent Solvers49
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!