Cody

# Problem 3011. Self-similarity 2 - Every third term

Solution 583640

Submitted on 16 Feb 2015 by Tim
• Size: 21
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% seq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

2   Pass
%% seq = [0, 1, 2, 1, 4, 7, 2, 5, 9, 1, 10, 19, 4, 13, 22, 7, 16, 25, 2, 11, 20, 5, 14, 23, 8, 17, 26, 1, 28, 55, 10, 37, 64, 19, 46, 73, 4, 31, 58, 13, 40, 67, 22, 49, 76, 7, 34, 61, 16, 43, 70, 25, 52, 79, 2, 29, 56, 11, 38, 65, 20, 47, 74, 5, 32, 59, 14, 41, 68, 23, 50, 77, 8, 35, 62, 17, 44, 71]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

3   Pass
%% seq = [0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 3, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 2, 3, 0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3, 4, 1, 1, 2, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 1, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

4   Pass
%% seq = [0, 1, 2, 1, 11, 12, 2, 12, 22, 1, 11, 12, 11, 12, 112, 12, 112, 122, 2, 12, 22, 12, 112, 122, 22, 122, 222, 1, 11, 12, 11, 111, 112, 12, 112, 122, 11, 111, 112, 111, 1111, 1112, 112, 1112, 1122, 12, 112, 122, 112, 1112, 1122, 122, 1122, 1222, 2, 12, 22, 12, 112]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

5   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

6   Pass
%% seq = [0, 1, 4, 1, 2, 5, 4, 5, 8, 1, 2, 5, 1, 3, 6, 5, 6, 9, 4, 5, 8, 5, 6, 9, 8, 9, 12, 1, 2, 5, 2, 3, 6, 5, 6, 9, 2, 3, 6, 3, 4, 7, 6, 7, 10, 5, 6, 9, 6, 7, 10, 9, 10, 13, 4, 5, 8, 5, 6, 9, 8, 9, 12, 5, 6, 9, 6, 7]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

7   Pass
%% seq = [1, 2, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

8   Pass
%% seq = [1, 12, 36, 12, 84, 72, 36, 96, 180, 12, 216, 180, 84, 168, 288, 72, 372, 216, 36, 240, 504, 96, 432, 288, 180, 372, 504, 12, 672, 360, 216, 384, 756, 144, 648, 576, 84, 456, 720, 168, 1080, 504, 288, 528, 1008, 72, 864, 576, 372, 684, 1116, 216, 1176, 648, 36]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

9   Pass
%% seq = [1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

10   Pass
%% seq = [0, 0, 1, 0, 1, 2, 1, 1, 2, 0, 0, 1, 0, 0, 3, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 2, 3, 0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3, 4, 1, 1, 2, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 1, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

11   Pass
%% seq = [1, 2, 3, 2, 4, 6, 3, 6, 9, 2, 4, 6, 4, 8, 12, 6, 12, 18, 3, 6, 9, 6, 12, 18, 9, 18, 27, 2, 4, 6, 4, 8, 12, 6, 12, 18, 4, 8, 12, 8, 16, 24, 12, 24, 36, 6, 12, 18, 12, 24, 36, 18, 36, 54, 3, 6, 9, 6, 12, 18, 9, 18, 27, 6, 12, 18, 12, 24, 36, 18, 36, 54, 9, 18, 27, 18, 36, 54, 27, 54]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

12   Pass
%% seq = [0, 1, 4, 1, 2, 5, 4, 5, 8, 1, 2, 5, 2, 3, 6, 5, 6, 9, 4, 5, 8, 5, 6, 9, 8, 9, 12, 1, 2, 5, 2, 3, 6, 5, 6, 9, 2, 3, 6, 3, 4, 7, 6, 7, 10, 5, 6, 9, 6, 7, 10, 9, 10, 13, 4, 5, 8, 5, 6, 9, 8, 9, 12, 5, 6, 9, 6, 7]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

13   Pass
%% seq = [1, 2, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

14   Pass
%% seq = [1, 12, 36, 12, 84, 72, 36, 96, 180, 12, 216, 144, 84, 168, 288, 72, 372, 216, 36, 240, 504, 96, 432, 288, 180, 372, 504, 12, 672, 360, 216, 384, 756, 144, 648, 576, 84, 456, 720, 168, 1080, 504, 288, 528, 1008, 72, 864, 576, 372, 684, 1116, 216, 1176, 648, 36]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

15   Pass
%% seq = [0, 1, 2, 2, 1, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

16   Pass
%% seq = [1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

17   Pass
%% seq = [0, 1, 2, 1, 4, 7, 2, 5, 8, 1, 10, 19, 4, 13, 22, 7, 16, 25, 2, 11, 20, 5, 14, 23, 8, 17, 26, 1, 28, 55, 10, 37, 64, 19, 46, 73, 4, 31, 58, 13, 40, 67, 22, 49, 76, 7, 34, 61, 16, 43, 70, 25, 52, 79, 2, 29, 56, 11, 38, 65, 20, 47, 74, 5, 32, 59, 14, 41, 68, 23, 50, 77, 8, 35, 62, 17, 44, 71]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

18   Pass
%% seq = [1, 1, 2, 1, 2, 3, 2, 3, 4, 1, 3, 5, 2, 4, 6, 3, 5, 7, 2, 4, 6, 3, 5, 7, 4, 6, 8, 1, 2, 3, 3, 4, 5, 5, 6, 7, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 4, 5, 6, 6, 7, 8, 8, 9, 10, 1, 3, 5, 2, 4, 6, 3, 5, 7, 3, 5, 7, 4, 6, 8, 5, 7, 9, 5, 7, 9]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

19   Pass
%% seq = [1, 2, 3, 2, 1, 1, 3, 1, 1, 2, 3, 2, 1, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

20   Pass
%% seq = [ 1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 4, 0, 0, 6, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 2, 12, 0, 0, 4, 0, 0, 0, 0, 6, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 6, 6, 0, 0, 12, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 4, 6, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 2, 12, 0, 0, 4, 0, 2, 0, 0, 12, 0, 0, 0, 0, 0, 0, 8, 0, 4, 0, 0, 0, 4, 0, 0, 6, 0]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

21   Pass
%% seq = [3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 3, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

22   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 6, 4, 2, 4, 12, 6, 4, 8, 0, 10, 0, 0, 16, 8, 6, 4, 12, 4, 14, 8, 2, 34, 12, 4, 16, 40, 12, 12, 48, 6, 28, 8, 4, 44, 24, 8, 16, 44, 0, 12, 24, 10, 58, 16, 0, 28, 36, 0, 24, 100, 16, 16, 48, 8, 28, 16, 6, 62]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

23   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 6, 4, 0, 10, 12, 0, 4, 8, 4, 4, 0, 0, 14, 8, 2, 12, 12, 0, 4, 8, 0, 8, 0, 6, 4, 4, 6, 8, 24, 4, 16, 8, 0, 8, 0, 10, 18, 8, 12, 34, 12, 0, 24, 44, 4, 8, 24, 8, 28, 12, 4, 46, 48, 4, 28, 36, 0, 16]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

24   Pass
%% seq = [0, 1, 2, 1, 4, 5, 2, 5, 8, 1, 3, 5, 4, 13, 14, 5, 14, 17, 2, 5, 8, 5, 14, 17, 8, 17, 26, 1, 4, 5, 4, 13, 14, 5, 14, 17, 4, 13, 14, 13, 40, 41, 14, 41, 44, 5, 14, 17, 14, 41, 44, 17, 44, 53, 2, 5, 8, 5, 14, 17, 8, 17, 26, 5, 14, 17, 14, 41, 44, 17, 44, 53, 8, 17, 26, 17, 44, 53, 26, 53, 80]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

25   Pass
%% seq = [1, 4, 4, 4, 20, 24, 4, 32, 52, 4, 24, 48, 20, 56, 32, 24, 116, 72, 4, 80, 120, 32, 48, 96, 52, 124, 56, 4, 160, 120, 24, 128, 244, 48, 72, 192, 20, 152, 80, 56, 312, 168, 32, 176, 240, 24, 96, 192, 116, 228, 124, 72, 280, 216, 4, 288, 416, 80, 120, 240, 120, 248, 128, 32, 500]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

26   Pass
%% seq = [1, 2, 3, 2, 4, 6, 3, 6, 9, 2, 4, 6, 4, 8, 16, 6, 12, 18, 3, 6, 9, 6, 12, 18, 9, 18, 27, 2, 4, 6, 4, 8, 12, 6, 12, 18, 4, 8, 12, 8, 16, 24, 12, 24, 36, 6, 12, 18, 12, 24, 36, 18, 36, 54, 3, 6, 9, 6, 12, 18, 9, 18, 27, 6, 12, 18, 12, 24, 36, 18, 36, 54, 9, 18, 27, 18, 36, 54, 27, 54]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

27   Pass
%% seq = [0, 1, 2, 1, 4, 5, 2, 5, 8, 1, 4, 5, 4, 13, 14, 5, 14, 17, 2, 5, 8, 5, 14, 17, 8, 17, 26, 1, 4, 5, 4, 13, 14, 5, 14, 17, 4, 13, 14, 13, 40, 41, 14, 41, 44, 5, 14, 17, 14, 41, 44, 17, 44, 53, 2, 5, 8, 5, 14, 17, 8, 17, 26, 5, 14, 17, 14, 41, 44, 17, 44, 53, 8, 17, 26, 17, 44, 53, 26, 53, 80]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

28   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 8, 4, 2, 10, 12, 0, 4, 8, 4, 4, 0, 0, 14, 8, 2, 12, 12, 0, 4, 8, 0, 8, 0, 6, 4, 4, 6, 8, 24, 4, 16, 8, 0, 8, 0, 10, 18, 8, 12, 34, 12, 0, 24, 44, 4, 8, 24, 8, 28, 12, 4, 46, 48, 4, 28, 36, 0, 16]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

29   Pass
%% seq = [1, 4, 4, 4, 20, 24, 4, 32, 52, 4, 24, 48, 40, 56, 32, 64, 116, 72, 4, 80, 120, 32, 48, 96, 52, 124, 56, 4, 160, 120, 24, 128, 244, 48, 72, 192, 20, 152, 80, 56, 312, 168, 32, 176, 240, 24, 96, 192, 116, 228, 124, 72, 280, 216, 4, 288, 416, 80, 120, 240, 120, 248, 128, 32, 500]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

30   Pass
%% seq = [0, 1, 2, 1, 11, 12, 2, 12, 22, 1, 11, 12, 11, 111, 112, 12, 112, 122, 2, 12, 22, 12, 112, 122, 22, 122, 222, 1, 11, 12, 11, 111, 112, 12, 112, 122, 11, 111, 112, 111, 1111, 1112, 112, 1112, 1122, 12, 112, 122, 112, 1112, 1122, 122, 1122, 1222, 2, 12, 22, 12, 112]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

31   Pass
%% seq = [1, 4, 4, 4, 4, 12, 4, 4, 4, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

32   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 4, 3, 4, 3, 1, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

33   Pass
%% seq = [1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 2, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

34   Pass
%% seq = [1, 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 5, 2, 4, 5, 3, 5, 7, 2, 4, 6, 3, 5, 7, 4, 6, 8, 1, 2, 3, 3, 4, 5, 5, 6, 7, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 4, 5, 6, 6, 7, 8, 8, 9, 10, 1, 3, 5, 2, 4, 6, 3, 5, 7, 3, 5, 7, 4, 6, 8, 5, 7, 9, 5, 7, 9]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

35   Pass
%% seq = [3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

36   Pass
%% seq = [1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

37   Pass
%% seq = [1, 4, 4, 4, 4, 12, 4, 4, 8, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

38   Pass
%% seq = [ 1, 2, 0, 2, 6, 0, 1, 4, 0, 2, 0, 0, 6, 4, 1, 0, 6, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 2, 12, 0, 0, 4, 0, 0, 0, 0, 6, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 6, 6, 0, 0, 12, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 4, 6, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 2, 12, 0, 0, 4, 0, 2, 0, 0, 12, 0, 0, 0, 0, 0, 0, 8, 0, 4, 0, 0, 0, 4, 0, 0, 6, 0]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

39   Pass
%% seq = [1, 2, 0, 2, 6, 0, 2, 6, 4, 2, 4, 12, 6, 4, 8, 2, 10, 0, 0, 16, 8, 6, 4, 12, 4, 14, 8, 2, 34, 12, 4, 16, 40, 12, 12, 48, 6, 28, 8, 4, 44, 24, 8, 16, 44, 0, 12, 24, 10, 58, 16, 0, 28, 36, 0, 24, 100, 16, 16, 48, 8, 28, 16, 6, 62]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

40   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))
The text passage contains a series of test cases for a function `self_similarity_2` that checks if a given sequence is self-similar. Each test case provides a sequence and the expected result (1 for self-similar, 0 for not self-similar). There are no explicit mathematical questions or calculations presented as questions in the text.
no_question
Given a text passage, determine:
    1. If it contains a mathematical question (including word problems or calculations)
    2. If an answer to that mathematical question is provided in the text

First, describe the content structure you found in 1-2 sentences.

Then provide your analysis in the following format:
TYPE: <one of the following values>
- NO_QUESTION
- SINGLE_QUESTION
- SINGLE_QUESTION_WITH_ANSWER
- MULTIPLE_QUESTIONS
- MULTIPLE_QUESTIONS_WITH_ANSWERS
system
Cody

# Problem 3011. Self-similarity 2 - Every third term

Solution 583640

Submitted on 16 Feb 2015 by Tim
• Size: 21
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% seq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

2   Pass
%% seq = [0, 1, 2, 1, 4, 7, 2, 5, 9, 1, 10, 19, 4, 13, 22, 7, 16, 25, 2, 11, 20, 5, 14, 23, 8, 17, 26, 1, 28, 55, 10, 37, 64, 19, 46, 73, 4, 31, 58, 13, 40, 67, 22, 49, 76, 7, 34, 61, 16, 43, 70, 25, 52, 79, 2, 29, 56, 11, 38, 65, 20, 47, 74, 5, 32, 59, 14, 41, 68, 23, 50, 77, 8, 35, 62, 17, 44, 71]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

3   Pass
%% seq = [0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 3, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 2, 3, 0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3, 4, 1, 1, 2, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 1, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

4   Pass
%% seq = [0, 1, 2, 1, 11, 12, 2, 12, 22, 1, 11, 12, 11, 12, 112, 12, 112, 122, 2, 12, 22, 12, 112, 122, 22, 122, 222, 1, 11, 12, 11, 111, 112, 12, 112, 122, 11, 111, 112, 111, 1111, 1112, 112, 1112, 1122, 12, 112, 122, 112, 1112, 1122, 122, 1122, 1222, 2, 12, 22, 12, 112]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

5   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

6   Pass
%% seq = [0, 1, 4, 1, 2, 5, 4, 5, 8, 1, 2, 5, 1, 3, 6, 5, 6, 9, 4, 5, 8, 5, 6, 9, 8, 9, 12, 1, 2, 5, 2, 3, 6, 5, 6, 9, 2, 3, 6, 3, 4, 7, 6, 7, 10, 5, 6, 9, 6, 7, 10, 9, 10, 13, 4, 5, 8, 5, 6, 9, 8, 9, 12, 5, 6, 9, 6, 7]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

7   Pass
%% seq = [1, 2, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

8   Pass
%% seq = [1, 12, 36, 12, 84, 72, 36, 96, 180, 12, 216, 180, 84, 168, 288, 72, 372, 216, 36, 240, 504, 96, 432, 288, 180, 372, 504, 12, 672, 360, 216, 384, 756, 144, 648, 576, 84, 456, 720, 168, 1080, 504, 288, 528, 1008, 72, 864, 576, 372, 684, 1116, 216, 1176, 648, 36]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

9   Pass
%% seq = [1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

10   Pass
%% seq = [0, 0, 1, 0, 1, 2, 1, 1, 2, 0, 0, 1, 0, 0, 3, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 2, 3, 0, 0, 1, 0, 0, 2, 1, 1, 2, 0, 0, 1, 0, 0, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3, 4, 1, 1, 2, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 1, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 3, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

11   Pass
%% seq = [1, 2, 3, 2, 4, 6, 3, 6, 9, 2, 4, 6, 4, 8, 12, 6, 12, 18, 3, 6, 9, 6, 12, 18, 9, 18, 27, 2, 4, 6, 4, 8, 12, 6, 12, 18, 4, 8, 12, 8, 16, 24, 12, 24, 36, 6, 12, 18, 12, 24, 36, 18, 36, 54, 3, 6, 9, 6, 12, 18, 9, 18, 27, 6, 12, 18, 12, 24, 36, 18, 36, 54, 9, 18, 27, 18, 36, 54, 27, 54]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

12   Pass
%% seq = [0, 1, 4, 1, 2, 5, 4, 5, 8, 1, 2, 5, 2, 3, 6, 5, 6, 9, 4, 5, 8, 5, 6, 9, 8, 9, 12, 1, 2, 5, 2, 3, 6, 5, 6, 9, 2, 3, 6, 3, 4, 7, 6, 7, 10, 5, 6, 9, 6, 7, 10, 9, 10, 13, 4, 5, 8, 5, 6, 9, 8, 9, 12, 5, 6, 9, 6, 7]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

13   Pass
%% seq = [1, 2, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

14   Pass
%% seq = [1, 12, 36, 12, 84, 72, 36, 96, 180, 12, 216, 144, 84, 168, 288, 72, 372, 216, 36, 240, 504, 96, 432, 288, 180, 372, 504, 12, 672, 360, 216, 384, 756, 144, 648, 576, 84, 456, 720, 168, 1080, 504, 288, 528, 1008, 72, 864, 576, 372, 684, 1116, 216, 1176, 648, 36]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

15   Pass
%% seq = [0, 1, 2, 2, 1, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

16   Pass
%% seq = [1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

17   Pass
%% seq = [0, 1, 2, 1, 4, 7, 2, 5, 8, 1, 10, 19, 4, 13, 22, 7, 16, 25, 2, 11, 20, 5, 14, 23, 8, 17, 26, 1, 28, 55, 10, 37, 64, 19, 46, 73, 4, 31, 58, 13, 40, 67, 22, 49, 76, 7, 34, 61, 16, 43, 70, 25, 52, 79, 2, 29, 56, 11, 38, 65, 20, 47, 74, 5, 32, 59, 14, 41, 68, 23, 50, 77, 8, 35, 62, 17, 44, 71]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

18   Pass
%% seq = [1, 1, 2, 1, 2, 3, 2, 3, 4, 1, 3, 5, 2, 4, 6, 3, 5, 7, 2, 4, 6, 3, 5, 7, 4, 6, 8, 1, 2, 3, 3, 4, 5, 5, 6, 7, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 4, 5, 6, 6, 7, 8, 8, 9, 10, 1, 3, 5, 2, 4, 6, 3, 5, 7, 3, 5, 7, 4, 6, 8, 5, 7, 9, 5, 7, 9]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

19   Pass
%% seq = [1, 2, 3, 2, 1, 1, 3, 1, 1, 2, 3, 2, 1, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

20   Pass
%% seq = [ 1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 4, 0, 0, 6, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 2, 12, 0, 0, 4, 0, 0, 0, 0, 6, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 6, 6, 0, 0, 12, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 4, 6, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 2, 12, 0, 0, 4, 0, 2, 0, 0, 12, 0, 0, 0, 0, 0, 0, 8, 0, 4, 0, 0, 0, 4, 0, 0, 6, 0]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

21   Pass
%% seq = [3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 3, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

22   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 6, 4, 2, 4, 12, 6, 4, 8, 0, 10, 0, 0, 16, 8, 6, 4, 12, 4, 14, 8, 2, 34, 12, 4, 16, 40, 12, 12, 48, 6, 28, 8, 4, 44, 24, 8, 16, 44, 0, 12, 24, 10, 58, 16, 0, 28, 36, 0, 24, 100, 16, 16, 48, 8, 28, 16, 6, 62]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

23   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 6, 4, 0, 10, 12, 0, 4, 8, 4, 4, 0, 0, 14, 8, 2, 12, 12, 0, 4, 8, 0, 8, 0, 6, 4, 4, 6, 8, 24, 4, 16, 8, 0, 8, 0, 10, 18, 8, 12, 34, 12, 0, 24, 44, 4, 8, 24, 8, 28, 12, 4, 46, 48, 4, 28, 36, 0, 16]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

24   Pass
%% seq = [0, 1, 2, 1, 4, 5, 2, 5, 8, 1, 3, 5, 4, 13, 14, 5, 14, 17, 2, 5, 8, 5, 14, 17, 8, 17, 26, 1, 4, 5, 4, 13, 14, 5, 14, 17, 4, 13, 14, 13, 40, 41, 14, 41, 44, 5, 14, 17, 14, 41, 44, 17, 44, 53, 2, 5, 8, 5, 14, 17, 8, 17, 26, 5, 14, 17, 14, 41, 44, 17, 44, 53, 8, 17, 26, 17, 44, 53, 26, 53, 80]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

25   Pass
%% seq = [1, 4, 4, 4, 20, 24, 4, 32, 52, 4, 24, 48, 20, 56, 32, 24, 116, 72, 4, 80, 120, 32, 48, 96, 52, 124, 56, 4, 160, 120, 24, 128, 244, 48, 72, 192, 20, 152, 80, 56, 312, 168, 32, 176, 240, 24, 96, 192, 116, 228, 124, 72, 280, 216, 4, 288, 416, 80, 120, 240, 120, 248, 128, 32, 500]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

26   Pass
%% seq = [1, 2, 3, 2, 4, 6, 3, 6, 9, 2, 4, 6, 4, 8, 16, 6, 12, 18, 3, 6, 9, 6, 12, 18, 9, 18, 27, 2, 4, 6, 4, 8, 12, 6, 12, 18, 4, 8, 12, 8, 16, 24, 12, 24, 36, 6, 12, 18, 12, 24, 36, 18, 36, 54, 3, 6, 9, 6, 12, 18, 9, 18, 27, 6, 12, 18, 12, 24, 36, 18, 36, 54, 9, 18, 27, 18, 36, 54, 27, 54]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

27   Pass
%% seq = [0, 1, 2, 1, 4, 5, 2, 5, 8, 1, 4, 5, 4, 13, 14, 5, 14, 17, 2, 5, 8, 5, 14, 17, 8, 17, 26, 1, 4, 5, 4, 13, 14, 5, 14, 17, 4, 13, 14, 13, 40, 41, 14, 41, 44, 5, 14, 17, 14, 41, 44, 17, 44, 53, 2, 5, 8, 5, 14, 17, 8, 17, 26, 5, 14, 17, 14, 41, 44, 17, 44, 53, 8, 17, 26, 17, 44, 53, 26, 53, 80]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

28   Pass
%% seq = [1, 2, 0, 2, 6, 0, 0, 4, 0, 2, 0, 0, 6, 8, 4, 2, 10, 12, 0, 4, 8, 4, 4, 0, 0, 14, 8, 2, 12, 12, 0, 4, 8, 0, 8, 0, 6, 4, 4, 6, 8, 24, 4, 16, 8, 0, 8, 0, 10, 18, 8, 12, 34, 12, 0, 24, 44, 4, 8, 24, 8, 28, 12, 4, 46, 48, 4, 28, 36, 0, 16]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

29   Pass
%% seq = [1, 4, 4, 4, 20, 24, 4, 32, 52, 4, 24, 48, 40, 56, 32, 64, 116, 72, 4, 80, 120, 32, 48, 96, 52, 124, 56, 4, 160, 120, 24, 128, 244, 48, 72, 192, 20, 152, 80, 56, 312, 168, 32, 176, 240, 24, 96, 192, 116, 228, 124, 72, 280, 216, 4, 288, 416, 80, 120, 240, 120, 248, 128, 32, 500]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

30   Pass
%% seq = [0, 1, 2, 1, 11, 12, 2, 12, 22, 1, 11, 12, 11, 111, 112, 12, 112, 122, 2, 12, 22, 12, 112, 122, 22, 122, 222, 1, 11, 12, 11, 111, 112, 12, 112, 122, 11, 111, 112, 111, 1111, 1112, 112, 1112, 1122, 12, 112, 122, 112, 1112, 1122, 122, 1122, 1222, 2, 12, 22, 12, 112]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

31   Pass
%% seq = [1, 4, 4, 4, 4, 12, 4, 4, 4, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

32   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 4, 3, 4, 3, 1, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

33   Pass
%% seq = [1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 2, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

34   Pass
%% seq = [1, 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 5, 2, 4, 5, 3, 5, 7, 2, 4, 6, 3, 5, 7, 4, 6, 8, 1, 2, 3, 3, 4, 5, 5, 6, 7, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 4, 4, 5, 6, 6, 7, 8, 3, 4, 5, 5, 6, 7, 7, 8, 9, 4, 5, 6, 6, 7, 8, 8, 9, 10, 1, 3, 5, 2, 4, 6, 3, 5, 7, 3, 5, 7, 4, 6, 8, 5, 7, 9, 5, 7, 9]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

35   Pass
%% seq = [3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3, 3, 6, 9, 6, 6, 3, 9, 3]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

36   Pass
%% seq = [1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2, 1, 3, 1, 1, 2, 3, 2, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))

37   Pass
%% seq = [1, 4, 4, 4, 4, 12, 4, 4, 8, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

38   Pass
%% seq = [ 1, 2, 0, 2, 6, 0, 1, 4, 0, 2, 0, 0, 6, 4, 1, 0, 6, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 2, 12, 0, 0, 4, 0, 0, 0, 0, 6, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 6, 6, 0, 0, 12, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 4, 6, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 2, 12, 0, 0, 4, 0, 2, 0, 0, 12, 0, 0, 0, 0, 0, 0, 8, 0, 4, 0, 0, 0, 4, 0, 0, 6, 0]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

39   Pass
%% seq = [1, 2, 0, 2, 6, 0, 2, 6, 4, 2, 4, 12, 6, 4, 8, 2, 10, 0, 0, 16, 8, 6, 4, 12, 4, 14, 8, 2, 34, 12, 4, 16, 40, 12, 12, 48, 6, 28, 8, 4, 44, 24, 8, 16, 44, 0, 12, 24, 10, 58, 16, 0, 28, 36, 0, 24, 100, 16, 16, 48, 8, 28, 16, 6, 62]; tf_corr = 0; assert(isequal(self_similarity_2(seq),tf_corr))

40   Pass
%% seq = [0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 1, 2, 3, 0, 1, 2, 1, 2, 3, 2, 3, 0, 1, 2, 3, 2, 3, 0, 3, 0, 1, 2, 3, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2]; tf_corr = 1; assert(isequal(self_similarity_2(seq),tf_corr))
user
The text passage contains a series of test cases for a function `self_similarity_2` that checks if a given sequence is self-similar. Each test case provides a sequence and the expected result (1 for self-similar, 0 for not self-similar). There are no explicit mathematical questions or calculations presented as questions in the text.

TYPE: NO_QUESTION