I'd like to get help with achieving periodicity.
Let's say I have a positive power $n$ of $2$:
I need to alter the sign of $n$ periodically according to the next behavior:
With integers from 0 to 5 sign should be +, with integers 6 and 11 sign should be -. Integers 12 to 17 should map to +, 18 ... 23 to -, and so on.
How do I alter the sign of the $n$ according to my definition? Should it be done with mod, sin, ???
This can probably be thought as periodicity of six rather than complex oscillations between 5, 6 and 12.