Batched sequence indexing

Hi,

could you post a minimal (slow) code snippet, which shows the desired results using loops?