To solve the problem, we need to analyze the quadratic equation given by:
\[
\tan^2 x - \tan x - a = 0
\]
where \( a \) is a natural number such that \( a \leq 100 \). We want to determine the number of values of \( a \) for which this equation has real roots.
### Step 1: Identify the coefficients
The equation can be rewritten in standard quadratic form \( Ax^2 + Bx + C = 0 \) where:
- \( A = 1 \)
- \( B = -1 \)
- \( C = -a \)
### Step 2: Calculate the discriminant
The discriminant \( D \) of a quadratic equation \( Ax^2 + Bx + C = 0 \) is given by:
\[
D = B^2 - 4AC
\]
Substituting the values of \( A \), \( B \), and \( C \):
\[
D = (-1)^2 - 4(1)(-a) = 1 + 4a
\]
### Step 3: Set the condition for real roots
For the quadratic equation to have real roots, the discriminant must be non-negative:
\[
D \geq 0 \implies 1 + 4a \geq 0
\]
This condition is always satisfied for \( a \geq 0 \).
### Step 4: Determine when the discriminant is a perfect square
Since we need the roots to be real and distinct, we also require that \( D \) is a perfect square:
\[
1 + 4a = k^2 \quad \text{for some integer } k
\]
Rearranging gives:
\[
4a = k^2 - 1 \implies a = \frac{k^2 - 1}{4}
\]
### Step 5: Find integer values of \( a \)
For \( a \) to be a natural number, \( k^2 - 1 \) must be divisible by 4. This means \( k^2 \equiv 1 \mod 4 \), which occurs when \( k \) is odd. Let \( k = 2m + 1 \) for some integer \( m \):
\[
k^2 = (2m + 1)^2 = 4m^2 + 4m + 1
\]
Substituting back into the equation for \( a \):
\[
a = \frac{(4m^2 + 4m + 1) - 1}{4} = m^2 + m
\]
### Step 6: Find the range of \( a \)
We need to find the values of \( m \) such that:
\[
m^2 + m \leq 100
\]
This is a quadratic inequality. Rearranging gives:
\[
m^2 + m - 100 \leq 0
\]
### Step 7: Solve the quadratic equation
The roots of the equation \( m^2 + m - 100 = 0 \) can be found using the quadratic formula:
\[
m = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} = \frac{-1 \pm \sqrt{1 + 400}}{2} = \frac{-1 \pm 21}{2}
\]
Calculating the roots gives:
\[
m = \frac{20}{2} = 10 \quad \text{and} \quad m = \frac{-22}{2} = -11
\]
### Step 8: Determine valid integer values of \( m \)
Since \( m \) must be a non-negative integer, the possible values of \( m \) are \( 0, 1, 2, \ldots, 10 \) (11 values).
### Step 9: Calculate corresponding values of \( a \)
Now we calculate \( a \) for \( m = 0 \) to \( 10 \):
- \( m = 0 \): \( a = 0 \)
- \( m = 1 \): \( a = 2 \)
- \( m = 2 \): \( a = 6 \)
- \( m = 3 \): \( a = 12 \)
- \( m = 4 \): \( a = 20 \)
- \( m = 5 \): \( a = 30 \)
- \( m = 6 \): \( a = 42 \)
- \( m = 7 \): \( a = 56 \)
- \( m = 8 \): \( a = 72 \)
- \( m = 9 \): \( a = 90 \)
- \( m = 10 \): \( a = 110 \) (not valid since \( a \leq 100 \))
### Conclusion
The valid values of \( a \) are \( 0, 2, 6, 12, 20, 30, 42, 56, 72, 90 \), which gives us a total of 10 elements in the set \( S \).
Thus, the number of elements in the set \( S \) is:
\[
\boxed{10}
\]