Let $n$ be a fixed positive integer. How many ways are there to write $n$ as a sum of positive integers,
\[n = a_1 + a_2 + \cdots a_k\]
with $k$ an arbitrary positive integer and $a_1 \le a_2 \le \cdots \le a_k \le a_1 + 1$? For example, with $n = 4$, there are four ways: $4$, $2 + 2$, $1 + 1 + 2$, $1 + 1 + 1 + 1$.
1. **Understanding the Problem:**
   We need to find the number of ways to write \( n \) as a sum of positive integers \( n = a_1 + a_2 + \cdots + a_k \) such that \( a_1 \le a_2 \le \cdots \le a_k \le a_1 + 1 \).

2. **Analyzing the Constraints:**
   - Each \( a_i \) is either \( a_1 \) or \( a_1 + 1 \).
   - The sequence is non-decreasing.
   - The sum of the sequence is \( n \).

3. **Formulating the Sequence:**
   Let \( a_1 = x \). Then each \( a_i \) is either \( x \) or \( x + 1 \). Suppose there are \( m \) terms equal to \( x \) and \( k - m \) terms equal to \( x + 1 \). The sum of the sequence is:
   \[
   mx + (k - m)(x + 1) = n
   \]
   Simplifying, we get:
   \[
   mx + kx - mx + k - m = n \implies kx + k - m = n \implies k(x + 1) - m = n
   \]

4. **Solving for \( k \) and \( m \):**
   - \( k \) must be a positive integer.
   - \( m \) must be a non-negative integer.
   - \( k(x + 1) \ge n \) and \( m = k(x + 1) - n \).

5. **Counting the Solutions:**
   - For each \( k \), \( x \) must be such that \( k(x + 1) \ge n \).
   - \( x \) must be an integer such that \( x \le \frac{n}{k} - 1 \).

6. **Summarizing the Results:**
   - For each \( k \) from 1 to \( n \), there is exactly one way to write \( n \) as a sum of \( k \) terms satisfying the given conditions.
   - Therefore, the number of ways to write \( n \) as a sum of positive integers under the given constraints is \( n \).

The final answer is \( \boxed{n} \).