Cody

# Problem 42496. Arithmetic/geometric sequence, 50/50

Solution 714871

Submitted on 14 Aug 2015 by Binbin Qi
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
%% x = 13; y_correct = 42; % coincidence? assert(isequal(a(x),y_correct))

2   Pass
%% x = 1; y_correct = 0; assert(isequal(a(x),y_correct))

3   Pass
%% x = 3; y_correct = 2; assert(isequal(a(x),y_correct))

4   Pass
%% x = 22; y_correct = 121; assert(isequal(a(x),y_correct))

5   Pass
%% x = 40; y_correct = 400; assert(isequal(a(x),y_correct))

6   Pass
%% x = 53; y_correct = 702; assert(isequal(a(x),y_correct))

7   Pass
%% x = 13; y_correct = 42; assert(isequal(a(x),y_correct))

8   Pass
%% x = 81; y_correct = 1640; assert(isequal(a(x),y_correct))

9   Pass
%% x = 193; y_correct = 9312; assert(isequal(a(x),y_correct))

10   Pass
%% x = 222; y_correct = 12321; assert(isequal(a(x),y_correct))

11   Pass
%% x = 253; y_correct = 16002; assert(isequal(a(x),y_correct))

12   Pass
%% x = 1e3; y_correct = 25e4; assert(isequal(a(x),y_correct))

13   Pass
%% x = 2015; y_correct = 1015056; assert(isequal(a(x),y_correct))

14   Pass
%% x = 4971; y_correct = 6177710; assert(isequal(a(x),y_correct))

15   Pass
%% x = 6638; y_correct = 11015761; assert(isequal(a(x),y_correct))

16   Pass
%% x = 9e3; y_correct = 2025e4; assert(isequal(a(x),y_correct))

17   Pass
%% x = 1956; y_correct = 956484; assert(isequal(a(x),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!