Cody

# Problem 235. Project Euler: Problem 4, Palindromic numbers

Solution 462787

Submitted on 26 Jun 2014 by rifat
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 = 999; y_correct = 906609; assert(isequal(euler004(x),y_correct))

mat = 906609 mat = 906609 886688 mat = 906609 886688 888888 mat = 906609 886688 888888 861168 mat = 906609 886688 888888 861168 888888 mat = 906609 886688 888888 861168 888888 861168 mat = 906609 886688 888888 861168 888888 861168 886688 mat = 906609 886688 888888 861168 888888 861168 886688 824428 mat = Columns 1 through 8 906609 886688 888888 861168 888888 861168 886688 824428 Column 9 906609 mat = Columns 1 through 8 906609 886688 888888 861168 888888 861168 886688 824428 Columns 9 through 10 906609 819918 mat = Columns 1 through 8 906609 886688 888888 861168 888888 861168 886688 824428 Columns 9 through 11 906609 819918 824428 mat = Columns 1 through 8 906609 886688 888888 861168 888888 861168 886688 824428 Columns 9 through 12 906609 819918 824428 819918

2   Pass
%% x = 9999; y_correct = 99000099; assert(isequal(euler004(x),y_correct))

mat = 99000099 mat = 99000099 99000099

3   Pass
%% x = 100; y_correct = 9009; assert(isequal(euler004(x),y_correct))

mat = 0 mat = 0 9009 mat = 0 9009 8118 mat = 0 9009 8118 7227 mat = 0 9009 8118 7227 6336 mat = 0 9009 8118 7227 6336 5445 mat = 0 9009 8118 7227 6336 5445 4554 mat = 0 9009 8118 7227 6336 5445 4554 3663 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Column 9 2772 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 10 2772 1881 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 11 2772 1881 99 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 12 2772 1881 99 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 13 2772 1881 99 0 686 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 14 2772 1881 99 0 686 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 15 2772 1881 99 0 686 0 5335 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Column 17 8448 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 18 8448 6336 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 19 8448 6336 4224 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 20 8448 6336 4224 2112 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 21 8448 6336 4224 2112 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 22 8448 6336 4224 2112 0 5225 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 23 8448 6336 4224 2112 0 5225 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Column 25 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 26 0 5115 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 27 0 5115 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 28 0 5115 0 828 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 29 0 5115 0 828 0 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 30 0 5115 0 828 0 9009 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 31 0 5115 0 828 0 9009 8008 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 32 0 5115 0 828 0 9009 8008 7007 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 32 0 5115 0 828 0 9009 8008 7007 Column 33 6006 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 32 0 5115 0 828 0 9009 8008 7007 Columns 33 through 34 6006 5005 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 99 0 686 0 5335 0 Columns 17 through 24 8448 6336 4224 2112 0 5225 0 282 Columns 25 through 32 0 5115 0 828 0 9009 8008 7007 Columns 33 through 35 6006 5005 4004 mat = Columns 1 through 8 0 9009 8118 7227 6336 5445 4554 3663 Columns 9 through 16 2772 1881 ...

4   Pass
%% x = 2500; y_correct = 6167616; assert(isequal(euler004(x),y_correct))

mat = 6167616 mat = 6167616 6145416 mat = 6167616 6145416 6014106 mat = 6167616 6145416 6014106 6145416 mat = 6167616 6145416 6014106 6145416 6167616 mat = 6167616 6145416 6014106 6145416 6167616 6039306 mat = 6167616 6145416 6014106 6145416 6167616 6039306 6039306 mat = 6167616 6145416 6014106 6145416 6167616 6039306 6039306 5870785 mat = Columns 1 through 8 6167616 6145416 6014106 6145416 6167616 6039306 6039306 5870785 Column 9 6014106 mat = Columns 1 through 8 6167616 6145416 6014106 6145416 6167616 6039306 6039306 5870785 Columns 9 through 10 6014106 5870785