Let $f_{0}(x)=x$, and for each $n\geq 0$, let $f_{n+1}(x)=f_{n}(x^{2}(3-2x))$. Find the smallest real number that is at least as large as
\[ \sum_{n=0}^{2017} f_{n}(a) + \sum_{n=0}^{2017} f_{n}(1-a)\]
for all $a \in [0,1]$.
1. **Base Case:**
   We start with the base case where \( k = 0 \). For any \( a \in [0, 1] \), we have:
   \[
   f_0(a) + f_0(1-a) = a + (1-a) = 1
   \]
   This satisfies the desired property.

2. **Inductive Step:**
   Assume that for some \( k = j \), the property holds:
   \[
   f_j(a) + f_j(1-a) = 1
   \]
   We need to show that this property holds for \( k = j+1 \). By the definition of the function sequence, we have:
   \[
   f_{j+1}(x) = f_j(x^2(3-2x))
   \]
   Therefore, we need to show:
   \[
   f_{j+1}(a) + f_{j+1}(1-a) = f_j(a^2(3-2a)) + f_j((1-a)^2(3-2(1-a)))
   \]
   Simplifying the argument of the second term:
   \[
   (1-a)^2(3-2(1-a)) = (1-a)^2(3-2+2a) = (1-a)^2(1+2a) = (1-a)^2 + 2a(1-a)^2
   \]
   Further simplifying:
   \[
   (1-a)^2 + 2a(1-a)^2 = 1 - 2a + a^2 + 2a(1 - 2a + a^2) = 1 - 2a + a^2 + 2a - 4a^2 + 2a^3 = 1 - 3a^2 + 2a^3
   \]
   Thus, we have:
   \[
   f_{j+1}(a) + f_{j+1}(1-a) = f_j(a^2(3-2a)) + f_j(1 - a^2(3-2a))
   \]
   Let \( b = a^2(3-2a) \). Then:
   \[
   f_j(b) + f_j(1-b) = 1
   \]
   by the inductive hypothesis. This completes the induction.

3. **Summation:**
   Since \( f_k(a) + f_k(1-a) = 1 \) for all \( k \) and \( a \in [0, 1] \), we have:
   \[
   \sum_{n=0}^{2017} f_n(a) + \sum_{n=0}^{2017} f_n(1-a) = \sum_{n=0}^{2017} 1 = 2018
   \]

The final answer is \(\boxed{2018}\)