Cody

Problem 45255. Find the sequence

Solution 3345013

Submitted on 23 Oct 2020 by Dyuman Joshi
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
n = 5; y_correct = 17; assert(isequal(seq_find(n),y_correct))

ans = 17

2   Pass
n = 7; y_correct = 65; assert(isequal(seq_find(n),y_correct))

ans = 65

3   Pass
n = 10; y_correct = 511; assert(isequal(seq_find(n),y_correct))

ans = 511

4   Pass
n = 14; y_correct = 8191; assert(isequal(seq_find(n),y_correct))

ans = 8191

5   Pass
n = 2; y_correct = 1; assert(isequal(seq_find(n),y_correct))

ans = 1

6   Pass
n = 22; y_correct =2097151; assert(isequal(seq_find(n),y_correct))

ans = 2097151

7   Pass
n = 27; y_correct =67108865; assert(isequal(seq_find(n),y_correct))

ans = 67108865