Do not you see a pattern there? Something like you're subtracting 41 from all values greater than 41 ... and you add 11 to all those under 41 .
This, I know well, I should put it as a comment (I still do not have enough "reputation" for it). But I would not want to "do your homework" either. I think I'll go to a mid-point and I'll describe the pseudo-code that I propose as a solution.
actualiza semana con (semana-11) si semana es mayor a 41;
and, subsequently
actualiza semana con (semana + 11) si semana es menor a 41;
Please, comment if you have found the solution. Greetings.