Let $P(x)$ be the period of $x$ base 2, for $x \in \mathbb{N}$, $x > 1$ and $gcd(x, 2) = 1$. i.e:
$$2^{P(x)} \equiv 1 \pmod{x}$$
Let $F(x)$ be a continuous function such that $P(x)$ divides $F(x)$ for all values of $x$.
$F(x) = 0$ is clearly a solution to this problem, and so is $F(x)=(x+k)!$, for integer values of $k > -2$
Question: Are there other solutions for $F$ besides those mentioned above? If so, what is the smallest, non-constant solution? By smallest, I mean the one function, among all solutions, that takes longer to grow.
And what happens if we generalize $P(x)$ for any base $a \in \mathbb{N}$, such that $gcd(x, a) = 1$? $$P(x,a) = a^{P(x,a)} \equiv 1 \pmod{x}$$