A function $f:\mathbb{N} \rightarrow \mathbb{N} $ is called nice if $f^a(b)=f(a+b-1)$, where $f^a(b)$ denotes $a$ times applied function $f$. 
Let $g$ be a nice function, and an integer $A$ exists such that $g(A+2018)=g(A)+1$. 
a) Prove that $g(n+2017^{2017})=g(n)$ for all $n \geq A+2$.
b) If $g(A+1) \neq g(A+1+2017^{2017})$ find $g(n)$ for $n <A$.
1. **Given Information and Definitions:**
   - A function \( f: \mathbb{N} \rightarrow \mathbb{N} \) is called nice if \( f^a(b) = f(a+b-1) \), where \( f^a(b) \) denotes \( a \) times applied function \( f \).
   - Let \( g \) be a nice function, and an integer \( A \) exists such that \( g(A+2018) = g(A) + 1 \).

2. **Assertion and Initial Steps:**
   - Let \( P(m, n) \) denote the assertion that \( f^n(m) = f(n+m-1) \) for all \( n, m \in \mathbb{N} \).
   - From \( P(1, m) \), we get:
     \[
     f^m(1) = f(m) \quad \text{(denoted as \(\clubsuit\))}
     \]

3. **Recursive Application:**
   - Using the recursive property of \( f \):
     \[
     f^k(m) = f^{k-1}(f(m)) = f^{k-1}(f^m(1)) = f^{m+k-1}(1)
     \]
   - Applying \( P(f^k(m), n) \):
     \[
     f^n(f^k(m)) = f(f^k(m) + n - 1)
     \]
   - But \( f^n(f^k(m)) = f^n(f^{m+k-1}(1)) = f^{m+k+n-1}(1) = f(m+k+n-1) \). Thus:
     \[
     f(f^k(m) + n - 1) = f(m+k+n-1)
     \]

4. **Cycle and Periodicity:**
   - This implies that \( f \) is eventually a cycle. Since the orbit of \( 1 \) goes through everything in the range of \( m \) (because of \(\clubsuit\)), we must have exactly one cycle, and that too in the orbit of \( 1 \).
   - Let the cycle length be \( c \). Then we must have:
     \[
     c \mid f^k(m) - m - k
     \]
   - Let this assertion be denoted by \( Q(m, k) \):
     \[
     Q(M, 1) \implies c \mid f(M) - M - 1
     \]
     \[
     Q(M+2022, 1) \implies c \mid f(M+2022) - M - 2022 - 1 = f(M) - M - 2022
     \]
   - Hence:
     \[
     c \mid 2021
     \]

5. **Further Analysis:**
   - See that \( f^{2024}(M) = f(f^{2023}(M)) = f(f(M+2022)) = f(f(M) + 1) \), but also \( f(f(M) + 1) = f(f(f(M))) = f^3(M) \). So, we have:
     \[
     f(M+2) = f^3(M) = f^{2024}(M)
     \]
   - From \( f(f(f(M))) = f(M+2) \) onwards, \( f \) is a cycle, so from the original equation, \( f \) is periodic mod \( 2021 \) from then onwards.

6. **Induction and Conclusion:**
   - We claim we must have \( |f(n) - n - 1| \ge M \) or \( f(n) - n - 1 = 0 \) for all \( n < M \).
   - Suppose we had \( f(N) - N - 1 = L < M \) for some \( N \). Then, since we had \( f(f^k(m) + n - 1) = f(m+n+k-1) \), putting \( k = 1 \) we get \( f(f(m) + n - 1) = f(m+n) \), and putting \( m = N \), we get that \( f(f(M) + n - 1) = f(M+n) \implies f(N+n+L) = f(N+n) \) which means, letting \( z = N+n \), \( f(z) = f(z+L) \) and so \( f(z) \) is part of the cycle for every \( z \ge N+1 \), but this means that for a number \( f(M+1) \) must also be part of the cycle, impossible by condition (ii) given.
   - Now, we will show that \( f(n) = n+1 \) for all \( n < M \) by induction. First, the base case \( n = 1 \), since if \( f(1) - 1 - 1 \neq 0 \), then \( f(1) \ge M+1+1 = M+2 \) meaning \( f(2) = f(M+2) \) which is part of the cycle, impossible.
   - Repeating the same thing for other numbers, we obtain that \( f(n) = n+1 \) for all \( n < M \).

The final answer is \( \boxed{ g(n) = n+1 } \) for all \( n < A \).