Cody

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

Solution 711550

Submitted on 6 Aug 2015 by James
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))

ans = 42

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

ans = 0

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

ans = 2

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

ans = 121

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

ans = 400

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

ans = 702

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

ans = 42

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

ans = 1640

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

ans = 9312

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

ans = 12321

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

ans = 16002

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

ans = 250000

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

ans = 1015056

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

ans = 6177710

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

ans = 11015761

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

ans = 20250000

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

ans = 956484