Cody

# Problem 3010. Self-similarity 1 - Every other term

Solution 1956713

Submitted on 2 Oct 2019 by Augusto Mazzei
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 = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 1

2   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

3   Pass
seq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

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

L = 54 ans = logical 1

5   Pass
seq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 8, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 51 ans = logical 0

6   Pass
seq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

7   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_1(seq),tf_corr))

L = 51 ans = logical 1

8   Pass
seq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 51 ans = logical 1

9   Pass
seq = [1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 0

10   Pass
seq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 2, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 46 ans = logical 0

11   Pass
seq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 8, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 44 ans = logical 1

12   Pass
seq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 50 ans = logical 0

13   Pass
seq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 390, 390, 54, 630, 174, 366]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 30 ans = logical 0

14   Pass
seq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 4, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 8, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 11, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 0

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

L = 44 ans = logical 1

16   Pass
seq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

17   Pass
seq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 144, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 27 ans = logical 1

18   Pass
seq = [0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2, 0, 0, 2, 1, 1, 2, 1, 1, 2, 1, 0, 2, 0, 0, 2, 2, 1, 2, 0, 1, 2, 0, 1, 3, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 0, 3, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 44 ans = logical 0

19   Pass
seq = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 0

20   Pass
seq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 54 ans = logical 0

21   Pass
seq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 1, 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_1(seq),tf_corr))

L = 51 ans = logical 0

22   Pass
seq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 51 ans = logical 0

23   Pass
seq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 0

24   Pass
seq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 51 ans = logical 1

25   Pass
seq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 1

26   Pass
seq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 48 ans = logical 1

27   Pass
seq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 1

28   Pass
seq = [1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 0

29   Pass
seq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 1

30   Pass
seq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

31   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

32   Pass
seq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 312, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 27 ans = logical 0

33   Pass
seq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 4, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 16, 16, 8, 16, 16, 32, 8, 8, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 44 ans = logical 0

34   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

35   Pass
seq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

36   Pass
seq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

37   Pass
seq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

38   Pass
seq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

39   Pass
seq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

40   Pass
seq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

41   Pass
seq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

42   Pass
seq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

43   Pass
seq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 50 ans = logical 1

44   Pass
seq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 0

45   Pass
seq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 318, 390, 54, 630, 174, 366]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 30 ans = logical 1

46   Pass
seq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 3, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 48 ans = logical 0

47   Pass
seq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 5, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 5, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 18, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 1

48   Pass
seq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 1

49   Pass
seq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

50   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 54 ans = logical 0

51   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 54 ans = logical 1

52   Pass
seq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

53   Pass
seq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

54   Pass
seq = [1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 1

55   Pass
seq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 41 ans = logical 0

56   Pass
seq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 45 ans = logical 1

57   Pass
seq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, -1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1]; tf_corr = 0; assert(isequal(self_similarity_1(seq),tf_corr))

L = 53 ans = logical 0

58   Pass
seq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19]; tf_corr = 1; assert(isequal(self_similarity_1(seq),tf_corr))

L = 46 ans = logical 1