Why do we need to elevate to the power of 2 in padded length?

Hi, I was doing the W1 assignment and i got stuck with the question of why is it necessary to 2^log2(input_token+1) i just cant understand the reason to do this, because this is always input_length+1. am i wrong?
Thanks!

+1 is for the case when input sequence has length 0.
This link should help you better understand why we use the power of 2.