Cody

# Problem 2575. Sum of series I

Solution 1940709

Submitted on 18 Sep 2019 by Ngo Minh Ngoc
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 = 1; s_correct = 1; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1

2   Pass
n = 2; s_correct = 4; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4

3   Pass
n = 10; s_correct = 100; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4 a = 5 s = 9 a = 7 s = 16 a = 9 s = 25 a = 11 s = 36 a = 13 s = 49 a = 15 s = 64 a = 17 s = 81 a = 19 s = 100

4   Pass
n = 15; s_correct = 225; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4 a = 5 s = 9 a = 7 s = 16 a = 9 s = 25 a = 11 s = 36 a = 13 s = 49 a = 15 s = 64 a = 17 s = 81 a = 19 s = 100 a = 21 s = 121 a = 23 s = 144 a = 25 s = 169 a = 27 s = 196 a = 29 s = 225

5   Pass
n = 42; s_correct = 1764; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4 a = 5 s = 9 a = 7 s = 16 a = 9 s = 25 a = 11 s = 36 a = 13 s = 49 a = 15 s = 64 a = 17 s = 81 a = 19 s = 100 a = 21 s = 121 a = 23 s = 144 a = 25 s = 169 a = 27 s = 196 a = 29 s = 225 a = 31 s = 256 a = 33 s = 289 a = 35 s = 324 a = 37 s = 361 a = 39 s = 400 a = 41 s = 441 a = 43 s = 484 a = 45 s = 529 a = 47 s = 576 a = 49 s = 625 a = 51 s = 676 a = 53 s = 729 a = 55 s = 784 a = 57 s = 841 a = 59 s = 900 a = 61 s = 961 a = 63 s = 1024 a = 65 s = 1089 a = 67 s = 1156 a = 69 s = 1225 a = 71 s = 1296 a = 73 s = 1369 a = 75 s = 1444 a = 77 s = 1521 a = 79 s = 1600 a = 81 s = 1681 a = 83 s = 1764

6   Pass
n = 101; s_correct = 10201; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4 a = 5 s = 9 a = 7 s = 16 a = 9 s = 25 a = 11 s = 36 a = 13 s = 49 a = 15 s = 64 a = 17 s = 81 a = 19 s = 100 a = 21 s = 121 a = 23 s = 144 a = 25 s = 169 a = 27 s = 196 a = 29 s = 225 a = 31 s = 256 a = 33 s = 289 a = 35 s = 324 a = 37 s = 361 a = 39 s = 400 a = 41 s = 441 a = 43 s = 484 a = 45 s = 529 a = 47 s = 576 a = 49 s = 625 a = 51 s = 676 a = 53 s = 729 a = 55 s = 784 a = 57 s = 841 a = 59 s = 900 a = 61 s = 961 a = 63 s = 1024 a = 65 s = 1089 a = 67 s = 1156 a = 69 s = 1225 a = 71 s = 1296 a = 73 s = 1369 a = 75 s = 1444 a = 77 s = 1521 a = 79 s = 1600 a = 81 s = 1681 a = 83 s = 1764 a = 85 s = 1849 a = 87 s = 1936 a = 89 s = 2025 a = 91 s = 2116 a = 93 s = 2209 a = 95 s = 2304 a = 97 s = 2401 a = 99 s = 2500 a = 101 s = 2601 a = 103 s = 2704 a = 105 s = 2809 a = 107 s = 2916 a = 109 s = 3025 a = 111 s = 3136 a = 113 s = 3249 a = 115 s = 3364 a = 117 s = 3481 a = 119 s = 3600 a = 121 s = 3721 a = 123 s = 3844 a = 125 s = 3969 a = 127 s = 4096 a = 129 s = 4225 a = 131 s = 4356 a = 133 s = 4489 a = 135 s = 4624 a = 137 s = 4761 a = 139 s = 4900 a = 141 s = 5041 a = 143 s = 5184 a = 145 s = 5329 a = 147 s = 5476 a = 149 s = 5625 a = 151 s = 5776 a = 153 s = 5929 a = 155 s = 6084 a = 157 s = 6241 a = 159 s = 6400 a = 161 s = 6561 a = 163 s = 6724 a = 165 s = 6889 a = 167 s = 7056 a = 169 s = 7225 a = 171 s = 7396 a = 173 s = 7569 a = 175 s = 7744 a = 177 s = 7921 a = 179 s = 8100 a = 181 s = 8281 a = 183 s = 8464 a = 185 s = 8649 a = 187 s = 8836 a = 189 s = 9025 a = 191 s = 9216 a = 193 s = 9409 a = 195 s = 9604 a = 197 s = 9801 a = 199 s = 10000 a = 201 s = 10201

7   Pass
n = 12345; s_correct = 152399025; assert(isequal(sumOfSeriesI(n),s_correct))

s = 0 a = 1 s = 1 a = 3 s = 4 a = 5 s = 9 a = 7 s = 16 a = 9 s = 25 a = 11 s = 36 a = 13 s = 49 a = 15 s = 64 a = 17 s = 81 a = 19 s = 100 a = 21 s = 121 a = 23 s = 144 a = 25 s = 169 a = 27 s = 196 a = 29 s = 225 a = 31 s = 256 a = 33 s = 289 a = 35 s = 324 a = 37 s = 361 a = 39 s = 400 a = 41 s = 441 a = 43 s = 484 a = 45 s = 529 a = 47 s = 576 a = 49 s = 625 a = 51 s = 676 a = 53 s = 729 a = 55 s = 784 a = 57 s = 841 a = 59 s = 900 a = 61 s = 961 a = 63 s = 1024 a = 65 s = 1089 a = 67 s = 1156 a = 69 s = 1225 a = 71 s = 1296 a = 73 s = 1369 a = 75 s = 1444 a = 77 s = 1521 a = 79 s = 1600 a = 81 s = 1681 a = 83 s = 1764 a = 85 s = 1849 a = 87 s = 1936 a = 89 s = 2025 a = 91 s = 2116 a = 93 s = 2209 a = 95 s = 2304 a = 97 s = 2401 a = 99 s = 2500 a = 101 s = 2601 a = 103 s = 2704 a = 105 s = 2809 a = 107 s = 2916 a = 109 s = 3025 a = 111 s = 3136 a = 113 s = 3249 a = 115 s = 3364 a = 117 s = 3481 a = 119 s = 3600 a = 121 s = 3721 a = 123 s = 3844 a = 125 s = 3969 a = 127 s = 4096 a = 129 s = 4225 a = 131 s = 4356 a = 133 s = 4489 a = 135 s = 4624 a = 137 s = 4761 a = 139 s = 4900 a = 141 s = 5041 a = 143 s = 5184 a = 145 s = 5329 a = 147 s = 5476 a = 149 s = 5625 a = 151 s = 5776 a = 153 s = 5929 a = 155 s = 6084 a = 157 s = 6241 a = 159 s = 6400 a = 161 s = 6561 a = 163 s = 6724 a = 165 s = 6889 a = 167 s = 7056 a = 169 s = 7225 a = 171 s = 7396 a = 173 s = 7569 a = 175 s = 7744 a = 177 s = 7921 a = 179 s = 8100 a = 181 s = 8281 a = 183 s = 8464 a = 185 s = 8649 a = 187 s = 8836 a = 189 s = 9025 a = 191 s = 9216 a = 193 s = 9409 a = 195 s = 9604 a = 197 s = 9801 a = 199 s = 10000 a = 201 s = 10201 a = 203 s = 10404 a = 205 s = 10609 a = 207 s = 10816 a = 209 s = 11025 a = 211 s = 11236 a = 213 s = 11449 a = 215 s = 11664 a = 217 s = 11881 a = 219 s = 12100 a = 221 s = 12321 a = 223 s = 12544 a = 225 s = 12769 a = 227 s = 12996 a = 229 s = 13225 a = 231 s = 13456 a = 233 s = 13689 a = 235 s = 13924 a = 237 s = 14161 a = 239 s = 14400 a = 241 s = 14641 a = 243 s = 14884 a = 245 s = 15129 a = 247 s = 15376 a = 249 s = 15625 a = 251 s = 15876 a = 253 s = 16129 a = 255 s = 16384 a = 257 s = 16641 a = 259 s = 16900 a = 261 s = 17161 a = 263 s = 17424 a = 265 s = 17689 a = 267 s = 17956 a = 269 s = 18225 a = 271 s = 18496 a = 273 s = 18769 a = 275 s = 19044 a = 277 s = 19321 a = 279 s = 19600 a = 281 s = 19881 a = 283 s = 20164 a = 285 s = 20449 a = 287 s = 20736 a = 289 s = 21025 a = 291 s = 21316 a = 293 s = 21609 a = 295 s = 21904 a = 297 s = 22201 a = 299 s = 22500 a = 301 s = 22801 a = 303 s = 23104 a = 305 s = 23409 a = 307 s = 23716 a = 309 s = 24025 a = 311 s = 24336 a = 313 s = 24649 a = 315 s = 24964 a = 317 s = 25281 a = 319 s = 25600 a = 321 s = 25921 a = 323 s = 26244 a = 325 s = 26569 a = 327 s = 26896 a = 329 s = 27225 a = 331 s = 27556 a = 333 s = 27889 a = 335 s = 28224 a = 337 s = 28561 a = 339 s = 28900 a = 341 s = 29241 a = 343 s = 29584 a = 345 s = 29929 a = 347 s = 30276 a = 349 s = 30625 a = 351 s = 30976 a = 353 s = 31329 a = 355 s = 31684 a = 357 s = 32041 a = 359 s = 32400 a = 361 s = 32761 a = 363 s = 33124 a = 365 s = 33489 a = 367 s = 33856 a = 369 s = 34225 a = 371 s = 34596 a = 373 s = 34969 a = 375 s = 35344 a = 377 s = 35721 a = 379 s = 36100 a = 381 s = 36481 a = 383 s = 36864 a = 385 s = 37249 a = 387 s = 37636 a = 389 s = 38025 a = 391 s = 38416 a = 393 s = 38809 a = 395 s = 39204 a = 397 s = 39601 a = 399 s = 40000 a = 401 s = 40401 a = 403 s = 40804 a = 405 s = 41209 a = 407 s = 41616 a = 409 s = 42025 a = 411 s = 42436 a = 413 s = 42849 a = 415 s = 43264 a = 417 s = 43681 a = 419 s = 44100 a = 421 s = 44521 a = 423 s = 44944 a = 425 s = 45369 a = 427 s = 45796 a = 429 s = 46225 a = 431 s = 46656 a = 433 s = 47089 a = 435 s = 47524 a = 437 s = 47961 a = 439 s = 48400 a = 441 s = 48841 a = 443 s = 49284 a = 445 s = 49729 a = 447 s = 50176 a = 449 s = 50625 a = 451 s = 51076 a = 453 s = 51529 a = 455 s = 51984 a = 457 s = 52441 a = 459 s = 52900 a = 461 s = 53361 a = 463 s = 53824 a = 465 s = 54289 a = 467 s = 54756 a = 469 s = 55225 a = 471 s = 55696 a = 473 s = 56169 a = 475 s = 56644 a = 477 s = 57121 a = 479 s = 57600 a = 481 s = 58081 a = 483 s = 58564 a = 485 s = 59049 a = 487 s = 59536 a = 489 s = 60025 a = 491 s = 60516 a = 493 s = 61009 a = 495 s = 61504 a = 497 s = 62001 a = 499 s = 62500 a = 501 s = 63001 a = 503 s = 63504 a = 505 s = 64009 a = 507 s = 64516 a = 509 s = 65025 a = 511 s = 65536 a = 513 s = 66049 a = 515 s = 66564 a = 517 s = 67081 a = 519 s = 67600 a = 521 s = 68121 a = 523 s = 68644 a = 525 s = 69169 a = 527 s = 69696 a = 529 s = 70225 a = 531 s = 70756 a = 533 s = 71289 a = 535 s = 71824 a = 537 s = 72361 a = 539 s = 72900 a = 541 s = 73441 a = 543 s = 73984 a = 545 s = 74529 a = 547 s = 75076 a = 549 s = 75625 a = 551 s = 76176 a = 553 s = 76729 a = 555 s = 77284 a = 557 s = 77841 a = 559 s = 78400 a = 561 s = 78961 a = 563 s = 79524 a = 565 s = 80089 a = 567 s = 80656 a = 569 s = 81225 a = 571 s = 81796 a = 573 s = 82369 a = 575 s = 82944 a = 577 s = 83521 a = 579 s = 84100 a = 581 s = 84681 a = 583 s = 85264 a = 585 s = 85849 a = 587 s = 86436 a = 589 s = 87025 a = 591 s = 87616 a = 593 s = 88209 a = 595 s = 88804 a = 597 s = 89401 a = ...