no segfault error, program running, changed 1/pow(i,2) to 1/pow(i,1) for easier manual test calculations