Update header.h

full formula for pi_r with for(...)