it reads:
frame number minus the remain of the division of number -1 when divided by 3
in essence its allways:
1 - (1-1=0 wich divided by 3 remains 0)= 1
2 - (2-1=1 wich divided by 3 remains 1)= 1
3 - (3-1=2 wich divided by 3 remains 2)= 1
4 - (3-1=3 wich divided by 3 remains 0)= 4
5 - (4-1=4 wich divided by 3 remains 1)= 4
6 - (5-1=5 wich divided by 3 remains 2)= 4
7 - (7-1=6 wich divided by 3 remains 0)= 7
8 - (8-1=7 wich divided by 3 remains 1)= 7
9 - (9-1=8 wich divided by 3 remains 2)= 7
....
so the sequence continues in manner 1 4 7 10 13 16 ....
now these are integers so 1/3=0, 2/3=0, 3/3=1 4/3 =1 because the numbers are truncated not rounded thus 0.9999999 =0 not 1 because the first number is 0
no dividing the sequence by 3 truncates it into a sequence of 0 1 2 3 4 5 6 .... but we wanted to start at 1 so we add 1