Is there a function that can be built with addition, multiplication, exponentiation, trigonometric functions, integrals, (and all of their inverses i.e subtraction, division, taking logarithms, $\arcsin(x)$, derivatives, etc) that would take an integer and output $1$ and take a non-integer and output $0$?
I looked at the Dirichlet Function but it separated rationals from irrationals, and the only solution that I could come up with was with the Fourier Series of $$x-\lfloor x \rfloor = \frac 12 - \frac 1\pi \sum_{k=1}^\infty \frac 1k \sin (2 \pi k x)$$ But this uses infinite series. Is there a way to build such a function? If there is not, why not?

  • 2
    $\begingroup$ It's trivial. Just take the left side of what you have in your formula above and call 1 iff it is 0, 0 otherwise. $\endgroup$ – Yiannis Galidakis Mar 12 '16 at 17:55
  • $\begingroup$ For your example, do you mean $1 - (\lceil x \rceil - \lfloor x \rfloor)$ instead of $x - \lfloor x \rfloor$? The latter is a sawtooth wave not an indicator function for the integers. $\endgroup$ – Dan Brumleve Mar 13 '16 at 0:03

Maybe this is cheating, but I don't think it's possible otherwise, since all of the other functions are continuous and a composition of continuous functions is continuous, integrals preserve continuity too, and even though differentiation doesn't in general, all of the functions you listed are not just continuous but analytic or infinitely differentiable so their derivatives are continuous as well at all orders. Anyway, here is my example:

$f(x) = 0^{\sin(\pi \cdot x)^2}$

For this to be correct you have to define $0^0=1$ which is not an unreasonable choice, but usually this expression is left undefined.

  • 1
    $\begingroup$ Wow, that is a really clever answer, I know I did not mention limits as possible building blocks for the function, but would $f(x) = \lim_{n \to x} 0^{\sin(\pi n)^2}$ be an equivalent statement to the one you gave? $\endgroup$ – Guacho Perez Mar 13 '16 at 6:36
  • $\begingroup$ Unfortunately no, that function is identically $0$ (regardless of how one defines $0^0$), for example: wolframalpha.com/input/… $\endgroup$ – Dan Brumleve Mar 13 '16 at 6:42
  • $\begingroup$ Is allowing limits the same as allowing derivatives? $\endgroup$ – Dan Brumleve Mar 13 '16 at 6:49
  • 1
    $\begingroup$ Yes, I think that in some twisted way allowing limits is the same thing as allowing derivatives. $\endgroup$ – Guacho Perez Mar 13 '16 at 7:14

It can be simply defined as an infinite product $$f(x)=\prod_{n=1}^{\infty}\cos^{2n}(\frac{\tau x}{2})$$ Where $\tau=2\pi$

  • $\begingroup$ Welcome to Math.SE! You could explain in your answer why this function is an answer to the question (it is not obvious to me). $\endgroup$ – fonini Jun 23 '16 at 23:57

Well.. you can always built it as a distribution:

$$ \Upsilon(x) = \begin{cases} 1 ~~~ \text{for} ~~~ x\in\mathbb{N} \\ 0 ~~~ \text{for} ~~~x\not\in\mathbb{N} \end{cases} $$


  • $\begingroup$ I think "built with" means composition of functions. $\endgroup$ – Dan Brumleve Mar 13 '16 at 0:20
  • $\begingroup$ Also allowed are applications of integrals and derivatives... But I don't see how that can be used to contruct an if-then statement, I explained why in my answer. $\endgroup$ – Dan Brumleve Mar 13 '16 at 0:28
  • $\begingroup$ (Also, this isn't what is usually meant by the word 'distribution'; the standard terminology is "piecewise function") $\endgroup$ – Eric Stucky Mar 13 '16 at 0:43
  • $\begingroup$ I just wanted to give a funny answer >.< $\endgroup$ – Von Neumann Mar 13 '16 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.