Solved by boucherm in post #5 
              
              
                I didn’t check the content of your formula. However, I see that you forgot ( or you are not familiar with the notation ) the flooring function ( the “L” and its symmetric counterpart ) around the formula.