# Why Refine does not simplify Cos[2*Pi*FractionalPart[1/2*(i + j + k)]] to $(-1)^{i+j+k}$?

I am obtaining in Mathematica:

Cos[2*Pi*FractionalPart[1/2*(i + j + k)]]


We know that for $i, j, k$ being positive integers this expression after simplification should give:

$$(-1)^{i+j+k}$$

I would like to know why the one of the solutions proposed for this similar question:

 Refine[Cos[2*Pi*FractionalPart[1/2*(i + j + k)]],
Assumptions -> {Element[{i, j, k}, Integers], i > 0, j > 0, k > 0}]


did not work for this case?

• @Kuba sorry, that was a copy paste issue from the real code.. I fixed now... Commented Feb 3, 2014 at 8:15
• Commented Feb 3, 2014 at 12:36
• @Artes this is not a duplicate because the question is asking why the Refine is not working in this case, while the other question was asking how to simplify the expression... Commented Feb 3, 2014 at 14:13
• @Artes I think that it is not a duplicate since Refine/FullSimplify works bad with FractionalPart. Commented Feb 3, 2014 at 15:32
• @ybeltukov I would retract my close vote if you provided at least a bit more optimal approach e.g. Simplify[Cos[ 2 Pi (# - Floor@#)&[(i + j + k)/2]], (i | j | k) ∈ Integers] Commented Feb 3, 2014 at 17:00

One can use x-Floor[x] instead of FractionalPart[x] for positive x

FullSimplify[Cos[2 Pi ((i + j + k)/2 - Floor[(i + j + k)/2])],
Assumptions -> (i | j | k) ∈ Integers]


(-1)^(i + j + k)

• ybeltukov, you haven't been active on this site recently. I want to let you know that your contributions are missed. Commented Jun 3, 2014 at 21:26
• @Mr.Wizard I'm sorry that I have no spare time to participate on this site now. I hope I'll be back in September or earlier. I was glad to talk with Leonid at the recent Wolfram conference in St. Petersburg. Commented Jun 4, 2014 at 13:46

Using the solution proposed in this answer also works:

FullSimplify[Cos[2 Pi FractionalPart[1/2 (i + j + k)]],
Assumptions -> {Element[i + j + k, Integers], i > 0, j > 0, k > 0},
ComplexityFunction -> LeafCount]


Giving:

(-1)^(i + j + k)