Harmonic Product Spectrum algorithm. I dont understand one step
"8000 / buffer_size"  is frequency resolution, decide by  sample length or "buffer_size",

you know the sampling interval is "1/8000", the whole time length 'T' of the sequence is "buffer_size/8000", then '1/T' is frequency resolution, 

in your code,if 'k' is 0, represent 0hz,is the signal's dc part,if 'k' is 1,represent '1/T' or "8000 / buffer_size" hz, then you can see 'k' correspond with frequency bin "k*8000 / buffer_size" .