It shouldn’t work. The following code works for any modulus.
def exceptEvery(nth, a):
     m = a.size(0) // nth * nth
     return torch.cat((a[:m].reshape(-1,nth)[:,:nth-1].reshape(-1), a[m:m+nth-1]))

>>> exceptEvery(2, torch.arange(11))
tensor([ 0,  2,  4,  6,  8, 10])
>>> exceptEvery(3, torch.arange(11))
tensor([ 0,  1,  3,  4,  6,  7,  9, 10])
>>> exceptEvery(4, torch.arange(11))
tensor([ 0,  1,  2,  4,  5,  6,  8,  9, 10])