For any natural number $n$, expressed in base $10$, let $S(n)$ denote the sum of all digits of $n$. Find all natural numbers $n$ such that $n=2S(n)^2$. 
1. Let \( n \) be a natural number with \( d \) digits. We know that \( n \) can be expressed as \( n = 2S(n)^2 \), where \( S(n) \) is the sum of the digits of \( n \).

2. Since \( n \) has \( d \) digits, it must satisfy:
   \[
   10^{d-1} \leq n < 10^d
   \]
   Given \( n = 2S(n)^2 \), we also have:
   \[
   2S(n)^2 \leq 2(9d)^2 = 162d^2
   \]
   Therefore:
   \[
   10^{d-1} \leq 2(9d)^2
   \]
   Simplifying, we get:
   \[
   10^{d-1} \leq 162d^2
   \]

3. We need to find the maximum \( d \) that satisfies this inequality. Testing values of \( d \):
   - For \( d = 1 \):
     \[
     10^0 = 1 \leq 162 \times 1^2 = 162 \quad \text{(True)}
     \]
   - For \( d = 2 \):
     \[
     10^1 = 10 \leq 162 \times 2^2 = 648 \quad \text{(True)}
     \]
   - For \( d = 3 \):
     \[
     10^2 = 100 \leq 162 \times 3^2 = 1458 \quad \text{(True)}
     \]
   - For \( d = 4 \):
     \[
     10^3 = 1000 \leq 162 \times 4^2 = 2592 \quad \text{(True)}
     \]
   - For \( d = 5 \):
     \[
     10^4 = 10000 \leq 162 \times 5^2 = 4050 \quad \text{(False)}
     \]

   Therefore, \( d \leq 4 \).

4. We now check the possible values of \( n \) for \( d \leq 4 \). We need to find \( n = 2S(n)^2 \) for \( S(n) \) values from 1 to 36 (since the maximum sum of digits for a 4-digit number is \( 9+9+9+9 = 36 \)).

5. We check each \( k = S(n) \) from 1 to 22 (since \( 2 \times 22^2 = 968 \), which is less than 1000):
   - For \( k = 1 \):
     \[
     n = 2 \times 1^2 = 2 \quad \text{(Not possible since } S(2) = 2)
     \]
   - For \( k = 2 \):
     \[
     n = 2 \times 2^2 = 8 \quad \text{(Not possible since } S(8) = 8)
     \]
   - For \( k = 3 \):
     \[
     n = 2 \times 3^2 = 18 \quad \text{(Not possible since } S(18) = 9)
     \]
   - For \( k = 4 \):
     \[
     n = 2 \times 4^2 = 32 \quad \text{(Not possible since } S(32) = 5)
     \]
   - For \( k = 5 \):
     \[
     n = 2 \times 5^2 = 50 \quad \text{(Possible since } S(50) = 5)
     \]
   - For \( k = 6 \):
     \[
     n = 2 \times 6^2 = 72 \quad \text{(Not possible since } S(72) = 9)
     \]
   - For \( k = 7 \):
     \[
     n = 2 \times 7^2 = 98 \quad \text{(Not possible since } S(98) = 17)
     \]
   - For \( k = 8 \):
     \[
     n = 2 \times 8^2 = 128 \quad \text{(Not possible since } S(128) = 11)
     \]
   - For \( k = 9 \):
     \[
     n = 2 \times 9^2 = 162 \quad \text{(Possible since } S(162) = 9)
     \]
   - For \( k = 10 \):
     \[
     n = 2 \times 10^2 = 200 \quad \text{(Not possible since } S(200) = 2)
     \]
   - For \( k = 11 \):
     \[
     n = 2 \times 11^2 = 242 \quad \text{(Not possible since } S(242) = 8)
     \]
   - For \( k = 12 \):
     \[
     n = 2 \times 12^2 = 288 \quad \text{(Not possible since } S(288) = 18)
     \]
   - For \( k = 13 \):
     \[
     n = 2 \times 13^2 = 338 \quad \text{(Not possible since } S(338) = 14)
     \]
   - For \( k = 14 \):
     \[
     n = 2 \times 14^2 = 392 \quad \text{(Possible since } S(392) = 14)
     \]
   - For \( k = 15 \):
     \[
     n = 2 \times 15^2 = 450 \quad \text{(Not possible since } S(450) = 9)
     \]
   - For \( k = 16 \):
     \[
     n = 2 \times 16^2 = 512 \quad \text{(Not possible since } S(512) = 8)
     \]
   - For \( k = 17 \):
     \[
     n = 2 \times 17^2 = 578 \quad \text{(Not possible since } S(578) = 20)
     \]
   - For \( k = 18 \):
     \[
     n = 2 \times 18^2 = 648 \quad \text{(Possible since } S(648) = 18)
     \]
   - For \( k = 19 \):
     \[
     n = 2 \times 19^2 = 722 \quad \text{(Not possible since } S(722) = 11)
     \]
   - For \( k = 20 \):
     \[
     n = 2 \times 20^2 = 800 \quad \text{(Not possible since } S(800) = 8)
     \]
   - For \( k = 21 \):
     \[
     n = 2 \times 21^2 = 882 \quad \text{(Not possible since } S(882) = 18)
     \]
   - For \( k = 22 \):
     \[
     n = 2 \times 22^2 = 968 \quad \text{(Not possible since } S(968) = 23)
     \]

6. The valid solutions are \( n = 50, 162, 392, 648 \).

The final answer is \( \boxed{50, 162, 392, 648} \).