My morning
The time: 4 in the morning. My sleep schedule: destroyed.
I woke up this morning and checked my phone. It was way too early for me, so I decided to head back to bed. Just before closing my eyes, I saw a notification—something about a math problem. There was no chance I was going back to bed.
The problem
The problem is pretty simple. We want to create a formula for the set:
There’s only one constraint: no using the modulus, floor, ceiling, or absolute value functions.
Before reading the rest of this post, I’d suggest trying to solve this problem on your own! I promise it’s fun.
A solution
The first thing I did to find the solution was to create a “base” function. This function would be able to model every other term (e.g. ). This function was pretty easy to find, just a basic line:
Let’s check our work:
Every odd value for works fine, but every even value fails! Let’s try to fix this by applying another function on top. The function on top must have some special oscillating nature such that it can be equal to for every odd value, and equal to for every even value.
My first thought was something similar to the business cycle curve:

And it turns out this works! The function gives us a table that looks like this:
Now all we have to do is transform this function to meet our criteria: .
Notice how I added the "" here. This is to shift the function off by one value of .
Look at that! Just the function we need. Now let’s add the two up to see our result:
Some additional solutions:
We’re not quite done yet. There’s one other (related) way to solve this problem I thought of. This way uses complex numbers! I was thinking about the spinning nature of and came up with the formula . This function acts similarly to . We can actually show why this is true using Euler’s formula ()! It can also be simplified to . I find the interconnectedness of all of these solutions pretty awesome!
Anyways, I hope this post was a fun read.
See you later,
Ilan Bernstein