Cody

# Problem 44321. Van Eck's Sequence's nth member

Solution 3059932

Submitted on 4 Oct 2020
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 = 1; y_correct = 0; assert(isequal(VanEcksSequence(x),y_correct))

result = 0

2   Fail
x = 2; y_correct = 0; assert(isequal(VanEcksSequence(x),y_correct))

result = 0 0

Assertion failed.

3   Fail
x = 4; y_correct = 0; assert(isequal(VanEcksSequence(x),y_correct))

result = 0 0 1 0

Assertion failed.

4   Fail
x = 6; y_correct = 0; assert(isequal(VanEcksSequence(x),y_correct))

result = 0 0 1 0 2 0

Assertion failed.

5   Fail
x = 11; y_correct = 0; assert(isequal(VanEcksSequence(x),y_correct))

result = 0 0 1 0 2 0 2 2 1 6 0

Assertion failed.

6   Fail
x = 50; y_correct = 3; assert(isequal(VanEcksSequence(x),y_correct))

result = Columns 1 through 29 0 0 1 0 2 0 2 2 1 6 0 5 0 2 6 5 4 0 5 3 0 3 2 9 0 4 9 3 6 Columns 30 through 50 14 0 6 3 5 15 0 5 3 5 2 17 0 6 11 0 3 8 0 3 3

Assertion failed.

7   Fail
x = 500; y_correct = 4; assert(isequal(VanEcksSequence(x),y_correct))

result = Columns 1 through 29 0 0 1 0 2 0 2 2 1 6 0 5 0 2 6 5 4 0 5 3 0 3 2 9 0 4 9 3 6 Columns 30 through 58 14 0 6 3 5 15 0 5 3 5 2 17 0 6 11 0 3 8 0 3 3 1 42 0 5 15 20 0 4 Columns 59 through 87 32 0 3 11 18 0 4 7 0 3 7 3 2 31 0 6 31 3 6 3 2 8 33 0 9 56 0 3 8 Columns 88 through 116 7 19 0 5 37 0 3 8 8 1 46 0 6 23 0 3 9 21 0 4 42 56 25 0 5 21 8 18 52 Columns 117 through 145 0 6 18 4 13 0 5 11 62 0 4 7 40 0 4 4 1 36 0 5 13 16 0 4 8 27 0 4 4 Columns 146 through 174 1 13 10 0 6 32 92 0 4 9 51 0 4 4 1 14 131 0 6 14 4 7 39 0 6 6 1 12 0 Columns 175 through 203 5 39 8 36 44 0 6 10 34 0 4 19 97 0 4 4 1 19 6 12 21 82 0 9 43 0 3 98 0 Columns 204 through 232 3 3 1 15 152 0 6 17 170 0 4 24 0 3 12 24 4 6 11 98 21 29 0 10 45 0 3 13 84 Columns 233 through 261 0 4 14 70 0 4 4 1 34 58 0 6 23 144 0 4 9 51 94 0 5 78 0 3 26 0 3 3 1 Columns 262 through 290 21 38 0 6 21 4 19 76 0 6 6 1 12 56 166 0 7 111 0 3 21 16 145 0 5 33 206 0 4 Columns 291 through 319 23 46 194 0 5 9 47 0 4 9 4 2 223 0 6 33 19 39 132 0 6 6 1 40 185 0 6 5 23 Columns 320 through 348 28 0 5 4 22 0 4 3 46 36 151 0 6 15 126 0 4 10 110 0 4 4 1 29 118 0 6 14 112 Columns 349 through 377 0 4 9 51 102 0 5 33 50 0 4 9 9 1 20 307 0 7 88 0 3 42 262 0 4 14 27 233 0 Columns 378 through 406 5 23 60 0 4 9 22 60 5 8 210 0 8 3 22 8 3 3 1 34 156 0 10 63 0 3 8 11 183 Columns 407 through 435 0 5 22 17 199 0 5 5 1 19 109 0 6 73 0 3 19 7 58 183 20 64 0 8 26 174 0 4 52 Columns 436 through 464 319 0 4 4 1 25 331 0 6 25 4 7 23 69 0 7 4 6 9 71 0 6 4 6 2 158 0 6 4 Columns 465 through 493 6 2 6 2 2 1 30 0 10 73 54 0 4 13 247 0 4 4 1 13 6 18 367 0 8 59 0 3 70 Columns 494 through 500 257 0 4 14 123 0 4

Assertion failed.

8   Fail
x = 5000; y_correct = 402; assert(isequal(VanEcksSequence(x),y_correct))

result = Columns 1 through 14 0 0 1 0 2 0 2 2 1 6 0 5 0 2 Columns 15 through 28 6 5 4 0 5 3 0 3 2 9 0 4 9 3 Columns 29 through 42 6 14 0 6 3 5 15 0 5 3 5 2 17 0 Columns 43 through 56 6 11 0 3 8 0 3 3 1 42 0 5 15 20 Columns 57 through 70 0 4 32 0 3 11 18 0 4 7 0 3 7 3 Columns 71 through 84 2 31 0 6 31 3 6 3 2 8 33 0 9 56 Columns 85 through 98 0 3 8 7 19 0 5 37 0 3 8 8 1 46 Columns 99 through 112 0 6 23 0 3 9 21 0 4 42 56 25 0 5 Columns 113 through 126 21 8 18 52 0 6 18 4 13 0 5 11 62 0 Columns 127 through 140 4 7 40 0 4 4 1 36 0 5 13 16 0 4 Columns 141 through 154 8 27 0 4 4 1 13 10 0 6 32 92 0 4 Columns 155 through 168 9 51 0 4 4 1 14 131 0 6 14 4 7 39 Columns 169 through 182 0 6 6 1 12 0 5 39 8 36 44 0 6 10 Columns 183 through 196 34 0 4 19 97 0 4 4 1 19 6 12 21 82 Columns 197 through 210 0 9 43 0 3 98 0 3 3 1 15 152 0 6 Columns 211 through 224 17 170 0 4 24 0 3 12 24 4 6 11 98 21 Columns 225 through 238 29 0 10 45 0 3 13 84 0 4 14 70 0 4 Columns 239 through 252 4 1 34 58 0 6 23 144 0 4 9 51 94 0 Columns 253 through 266 5 78 0 3 26 0 3 3 1 21 38 0 6 21 Columns 267 through 280 4 19 76 0 6 6 1 12 56 166 0 7 111 0 Columns 281 through 294 3 21 16 145 0 5 33 206 0 4 23 46 194 0 Columns 295 through 308 5 9 47 0 4 9 4 2 223 0 6 33 19 39 Columns 309 through 322 132 0 6 6 1 40 185 0 6 5 23 28 0 5 Columns 323 through 336 4 22 0 4 3 46 36 151 0 6 15 126 0 4 Columns 337 through 350 10 110 0 4 4 1 29 118 0 6 14 112 0 4 Columns 351 through 364 9 51 102 0 5 33 50 0 4 9 9 1 20 307 Columns 365 through 378 0 7 88 0 3 42 262 0 4 14 27 233 0 5 Columns 379 through 392 23 60 0 4 9 22 60 5 8 210 0 8 3 22 Columns 393 through 406 8 3 3 1 34 156 0 10 63 0 3 8 11 183 Columns 407 through 420 0 5 22 17 199 0 5 5 1 19 109 0 6 73 Columns 421 through 434 0 3 19 7 58 183 20 64 0 8 26 174 0 4 Columns 435 through 448 52 319 0 4 4 1 25 331 0 6 25 4 7 23 Columns 449 through 462 69 0 7 4 6 9 71 0 6 4 6 2 158 0 Columns 463 through 476 6 4 6 2 6 2 2 1 30 0 10 73 54 0 Columns 477 through 490 4 13 247 0 4 4 1 13 6 18 367 0 8 59 Columns 491 through 504 0 3 70 257 0 4 14 123 0 4 4 1 19 80 Columns 505 through 518 0 6 21 225 0 4 9 57 0 4 4 1 14 20 Columns 519 through 532 91 0 7 70 29 180 0 5 112 179 0 4 15 198 Columns 533 through 546 0 4 4 1 20 19 35 0 7 20 5 17 134 0 Columns 547 through 560 6 41 0 3 58 126 218 0 5 12 282 0 4 24 Columns 561 through 574 341 0 4 4 1 29 43 368 0 7 29 5 17 29 Columns 575 through 588 3 25 131 415 0 10 107 0 3 8 95 0 4 23 Columns 589 through 602 140 0 4 4 1 28 274 0 6 50 241 0 4 9 Columns 603 through 616 91 84 372 0 6 10 28 15 79 0 6 6 1 22 Columns 617 through 630 207 0 6 5 48 0 4 22 8 41 78 373 0 7 Columns 631 through 644 60 246 0 4 11 230 0 4 4 1 25 65 0 6 Columns 645 through 658 25 4 7 17 75 0 7 4 6 9 52 220 0 7 Columns 659 through 672 7 1 20 119 0 6 11 30 195 0 5 49 0 3 Columns 673 through 686 89 0 3 3 1 17 30 13 196 0 8 58 133 0 Columns 687 through 700 4 35 149 0 4 4 1 16 411 0 6 33 342 0 Columns 701 through 714 4 9 48 82 508 0 6 10 100 0 ...

Assertion failed.

9   Fail
x = 50000; y_correct = 114; assert(isequal(VanEcksSequence(x),y_correct))

result = Columns 1 through 14 0 0 1 0 2 0 2 2 1 6 0 5 0 2 Columns 15 through 28 6 5 4 0 5 3 0 3 2 9 0 4 9 3 Columns 29 through 42 6 14 0 6 3 5 15 0 5 3 5 2 17 0 Columns 43 through 56 6 11 0 3 8 0 3 3 1 42 0 5 15 20 Columns 57 through 70 0 4 32 0 3 11 18 0 4 7 0 3 7 3 Columns 71 through 84 2 31 0 6 31 3 6 3 2 8 33 0 9 56 Columns 85 through 98 0 3 8 7 19 0 5 37 0 3 8 8 1 46 Columns 99 through 112 0 6 23 0 3 9 21 0 4 42 56 25 0 5 Columns 113 through 126 21 8 18 52 0 6 18 4 13 0 5 11 62 0 Columns 127 through 140 4 7 40 0 4 4 1 36 0 5 13 16 0 4 Columns 141 through 154 8 27 0 4 4 1 13 10 0 6 32 92 0 4 Columns 155 through 168 9 51 0 4 4 1 14 131 0 6 14 4 7 39 Columns 169 through 182 0 6 6 1 12 0 5 39 8 36 44 0 6 10 Columns 183 through 196 34 0 4 19 97 0 4 4 1 19 6 12 21 82 Columns 197 through 210 0 9 43 0 3 98 0 3 3 1 15 152 0 6 Columns 211 through 224 17 170 0 4 24 0 3 12 24 4 6 11 98 21 Columns 225 through 238 29 0 10 45 0 3 13 84 0 4 14 70 0 4 Columns 239 through 252 4 1 34 58 0 6 23 144 0 4 9 51 94 0 Columns 253 through 266 5 78 0 3 26 0 3 3 1 21 38 0 6 21 Columns 267 through 280 4 19 76 0 6 6 1 12 56 166 0 7 111 0 Columns 281 through 294 3 21 16 145 0 5 33 206 0 4 23 46 194 0 Columns 295 through 308 5 9 47 0 4 9 4 2 223 0 6 33 19 39 Columns 309 through 322 132 0 6 6 1 40 185 0 6 5 23 28 0 5 Columns 323 through 336 4 22 0 4 3 46 36 151 0 6 15 126 0 4 Columns 337 through 350 10 110 0 4 4 1 29 118 0 6 14 112 0 4 Columns 351 through 364 9 51 102 0 5 33 50 0 4 9 9 1 20 307 Columns 365 through 378 0 7 88 0 3 42 262 0 4 14 27 233 0 5 Columns 379 through 392 23 60 0 4 9 22 60 5 8 210 0 8 3 22 Columns 393 through 406 8 3 3 1 34 156 0 10 63 0 3 8 11 183 Columns 407 through 420 0 5 22 17 199 0 5 5 1 19 109 0 6 73 Columns 421 through 434 0 3 19 7 58 183 20 64 0 8 26 174 0 4 Columns 435 through 448 52 319 0 4 4 1 25 331 0 6 25 4 7 23 Columns 449 through 462 69 0 7 4 6 9 71 0 6 4 6 2 158 0 Columns 463 through 476 6 4 6 2 6 2 2 1 30 0 10 73 54 0 Columns 477 through 490 4 13 247 0 4 4 1 13 6 18 367 0 8 59 Columns 491 through 504 0 3 70 257 0 4 14 123 0 4 4 1 19 80 Columns 505 through 518 0 6 21 225 0 4 9 57 0 4 4 1 14 20 Columns 519 through 532 91 0 7 70 29 180 0 5 112 179 0 4 15 198 Columns 533 through 546 0 4 4 1 20 19 35 0 7 20 5 17 134 0 Columns 547 through 560 6 41 0 3 58 126 218 0 5 12 282 0 4 24 Columns 561 through 574 341 0 4 4 1 29 43 368 0 7 29 5 17 29 Columns 575 through 588 3 25 131 415 0 10 107 0 3 8 95 0 4 23 Columns 589 through 602 140 0 4 4 1 28 274 0 6 50 241 0 4 9 Columns 603 through 616 91 84 372 0 6 10 28 15 79 0 6 6 1 22 Columns 617 through 630 207 0 6 5 48 0 4 22 8 41 78 373 0 7 Columns 631 through 644 60 246 0 4 11 230 0 4 4 1 25 65 0 6 Columns 645 through 658 25 4 7 17 75 0 7 4 6 9 52 220 0 7 Columns 659 through 672 7 1 20 119 0 6 11 30 195 0 5 49 0 3 Columns 673 through 686 89 0 3 3 1 17 30 13 196 0 8 58 133 0 Columns 687 through 700 4 35 149 0 4 4 1 16 411 0 6 33 342 0 Columns 701 through 714 4 9 48 82 508 0 6 10 100 0 ...

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!