I think some parts of this answer are not easy to understand, so I added some explanations.
The meaning of this answer is
physical block in the question >> should be logical block
logical block in the question >> should be virtual block
If the first (or zeroth) logical block of the file is Z, then the mapping from any virtual block to logical block N is N-Z.
0
1
2
...
Z --- 0
Z+1 --- 1
... --- ...
N-1 --- N-Z-1
N --- N-Z
The left side is the logical block number and the right side is the virtual block number.
Y + 1 is the displacement into the last physical block.
Y + 1
"+ 1" means that "pointer to next block" is in front and "511 bytes of data" is behind.