It's largely arithmetic. For example, -1+ 1= 0 so that middle term is k-1+ 1= k. And 2(k- 1)= 2k- 2 so that 2(k-1)+1= 2k- 2+ 1= 2k- 1.

I don't understand how they managed to ditch so many ks and other numbers.

I don't get algebra at all so the most basic explanation would be good.

Thanks