Let k be a positive integer. Find the number of non-negative integers n less than or equal to $10^k$ satisfying the following conditions:
(i) n is divisible by 3;
(ii) Each decimal digit of n is one of the digits 2,0,1 or 7.
1. **Define the problem in terms of modular arithmetic:**
   Let \( a_k^{(l)} \) be the number of \( k \)-digit numbers that are congruent to \( l \mod 3 \), where \( l = 0, 1, 2 \). We need to find \( a_k^{(0)} \), the number of \( k \)-digit numbers that are divisible by 3.

2. **Use properties of roots of unity:**
   Let \( \varepsilon = e^{2\pi i / 3} = \cos(2\pi / 3) + i \sin(2\pi / 3) \). Note that \( 1 + \varepsilon + \varepsilon^2 = 0 \) and \( \varepsilon^a = \varepsilon^b \) if \( a \equiv b \mod 3 \).

3. **Sum of all \( k \)-digit numbers:**
   The total number of \( k \)-digit numbers using the digits \( \{0, 1, 2, 7\} \) is \( 4^k \). Therefore,
   \[
   a_k^{(0)} + a_k^{(1)} + a_k^{(2)} = 4^k
   \]

4. **Sum of \( k \)-digit numbers weighted by roots of unity:**
   Consider the sum
   \[
   a_k^{(0)} + a_k^{(1)} \varepsilon + a_k^{(2)} \varepsilon^2 = \sum_{x_1, x_2, \ldots, x_k \in \{0, 1, 2, 7\}} \varepsilon^{x_1 + x_2 + \cdots + x_k}
   \]
   Each digit \( x_i \) can be \( 0, 1, 2, \) or \( 7 \). Since \( \varepsilon^7 = \varepsilon \), the sum simplifies to
   \[
   (\varepsilon^0 + \varepsilon^1 + \varepsilon^2 + \varepsilon^1)^k = (\varepsilon^0 + 2\varepsilon^1 + \varepsilon^2)^k = (1 + 2\varepsilon + \varepsilon^2)^k
   \]
   Using \( 1 + \varepsilon + \varepsilon^2 = 0 \), we get
   \[
   1 + 2\varepsilon + \varepsilon^2 = 1 + 2\varepsilon - 1 = 2\varepsilon
   \]
   Therefore,
   \[
   a_k^{(0)} + a_k^{(1)} \varepsilon + a_k^{(2)} \varepsilon^2 = (2\varepsilon)^k
   \]

5. **Case when \( k \) is divisible by 3:**
   If \( k \) is divisible by 3, then \( (2\varepsilon)^k = (2^k)(\varepsilon^k) = 2^k \cdot 1 = 2^k \). Thus,
   \[
   a_k^{(0)} + a_k^{(1)} \varepsilon + a_k^{(2)} \varepsilon^2 = 2^k
   \]
   We have two equations:
   \[
   a_k^{(0)} + a_k^{(1)} + a_k^{(2)} = 4^k
   \]
   \[
   a_k^{(0)} + a_k^{(1)} \varepsilon + a_k^{(2)} \varepsilon^2 = 2^k
   \]
   Using \( 1 + \varepsilon + \varepsilon^2 = 0 \), we can solve these equations. Subtracting the second equation from the first, we get:
   \[
   a_k^{(1)} (1 - \varepsilon) + a_k^{(2)} (1 - \varepsilon^2) = 4^k - 2^k
   \]
   Since \( 1 - \varepsilon = -\varepsilon^2 \) and \( 1 - \varepsilon^2 = -\varepsilon \), we have:
   \[
   a_k^{(1)} (-\varepsilon^2) + a_k^{(2)} (-\varepsilon) = 4^k - 2^k
   \]
   Simplifying, we get:
   \[
   -\varepsilon^2 a_k^{(1)} - \varepsilon a_k^{(2)} = 4^k - 2^k
   \]
   Since \( \varepsilon \) and \( \varepsilon^2 \) are roots of unity, we can solve for \( a_k^{(0)} \):
   \[
   a_k^{(0)} = \frac{4^k + 2^k}{3}
   \]

The final answer is \( \boxed{\frac{4^k + 2^k}{3}} \).