Problem

Source: St Petersburg Olympiad 2014, Grade 11, P1

Tags: number theory, function



Let $f(x)$ is such function, that $f(x)=1$ for integer $x$ and $f(x)=0$ for non integer $x$. Build such function using only variable $x$, integer numbers, and operations $+,-,*,/,[.]$(plus, minus, multiply,divide and integer part)