# Valid Sets (The actual NIMO 2012 3.9)

**Discrete Mathematics**Level 5

Let \(f(x) = x^2 - 2x\). A set of real numbers \(S\) is **valid** if it satisfies the following:

1) If \(x \in S\), then \(f(x) \in S\).

2) If \(x \in S\) and \(\underbrace{f(f(\dots f}_{k\ f\text{'s}}(x)\dots )) = x\) for some integer \(k\), then \(f(x) = x\).

Find the number of 8-element valid sets.