Solidworks equation logic question

I am an engineering student with a project involving equations.

  When my global variable is an even number, my equation needs to be (a/2) - 1.  When it is odd, it should be just a - 1.  Is it possible to make a logic rule in SolidWorks to allow this?

10
20
32
41
54
62
76
83
98
104
1110
125
1312
146
1514
167
1716
188
1918
209
......

Thanks!

SolidworksGeneral