If $k$ is an integer, let $\mathrm{c}(k)$ denote the largest cube that is less than or equal to $k$. Find all positive integers $p$ for which the following sequence is bounded:
$a_0 = p$ and $a_{n+1} = 3a_n-2\mathrm{c}(a_n)$ for $n \geqslant 0$.
1. **Initial Setup and Sequence Definition:**
   We start with the sequence defined by \( a_0 = p \) and \( a_{n+1} = 3a_n - 2\mathrm{c}(a_n) \) for \( n \geq 0 \), where \( \mathrm{c}(k) \) denotes the largest cube less than or equal to \( k \).

2. **Analyzing the Sequence:**
   We need to determine the conditions under which the sequence \( \{a_n\} \) is bounded. First, observe that:
   \[
   a_{n+1} = 3a_n - 2\mathrm{c}(a_n)
   \]
   Since \( \mathrm{c}(a_n) \leq a_n \), we have:
   \[
   a_{n+1} \geq 3a_n - 2a_n = a_n
   \]
   This implies that the sequence is non-decreasing.

3. **Condition for Boundedness:**
   For the sequence to be bounded, it must eventually become constant. This means there exists some \( N \) such that \( a_{N+1} = a_N \). If \( a_{n+1} = a_n \), then:
   \[
   3a_n - 2\mathrm{c}(a_n) = a_n
   \]
   Simplifying, we get:
   \[
   2a_n = 2\mathrm{c}(a_n) \implies a_n = \mathrm{c}(a_n)
   \]
   Therefore, \( a_n \) must be a perfect cube.

4. **Perfect Cube Condition:**
   Suppose \( a_k \) is a perfect cube, say \( a_k = m^3 \). Then:
   \[
   a_{k+1} = 3a_k - 2\mathrm{c}(a_k) = 3m^3 - 2m^3 = m^3
   \]
   This implies that if \( a_k \) is a perfect cube, then \( a_{k+1} \) is also a perfect cube.

5. **Backward Induction:**
   Suppose \( a_k = m^3 \) for some \( k \). Then:
   \[
   m^3 = 3a_{k-1} - 2\mathrm{c}(a_{k-1})
   \]
   Let \( \mathrm{c}(a_{k-1}) = b^3 \). Then:
   \[
   m^3 + 2b^3 = 3a_{k-1}
   \]
   This implies:
   \[
   m + 2b \equiv 0 \pmod{3} \implies m \equiv b \pmod{3}
   \]
   Let \( m = b + 3l \) for some integer \( l \). If \( l \geq 1 \), then:
   \[
   3a_{k-1} = 2b^3 + (b + 3l)^3 = 2b^3 + b^3 + 9b^2l + 27bl^2 + 27l^3 = 3b^3 + 9b^2l + 27bl^2 + 27l^3
   \]
   This implies:
   \[
   a_{k-1} = b^3 + 3b^2l + 9bl^2 + 9l^3 > (b+1)^3
   \]
   This contradicts \( \mathrm{c}(a_{k-1}) = b^3 \). Therefore, \( l = 0 \) and \( m = b \), meaning \( a_{k-1} = b^3 \).

6. **Conclusion:**
   By induction, if \( a_k \) is a perfect cube, then \( a_{k-1} \) is also a perfect cube. Therefore, if the sequence is bounded, \( a_n \) must be a perfect cube for all \( n \), starting from \( a_0 = p \). Hence, \( p \) must be a perfect cube.

The final answer is \( \boxed{ p } \) must be a perfect cube.