I'm having some trouble understanding the problem. Could you provide an example for test 7?
base=7;nstart=1;nend=10;y_correct=1265;
My understanding of the problem leads me to believe the answer should be 1600: 1 + 7 + 8 + 49 + 50 + 56 + 343 + 344 + 350 + 392