FFT: do I need to include gaps in data in my FFT domain?
A = [0, 0, 5, 10, 0, 0, 0, 23, 24]
  
  If I fft A, will it give me the same answer as if I fft B, where
  
  B = [5, 10, 23, 24]


No.

The reason for this is not in what effect does the sample has to the amplitude but in that you would effectively be changing the phase. That is, the relative timing of the sample with respect to the rest.

The Discrete Fourier Transform for a sequence of samples is:

$$ X_k = \sum_{n=0}^{N-1} x_n \cdot \left(\cos\left(\frac{2 \pi kn}{N}\right)-i \sin\left(\frac{2 \pi kn}{N}\right)\right)$$

Where:


$x_n$ is the $n^{th}$ sample of your data sequence $x$ (your vibration data)
$N$ is the length of the sequence


Given the sequence: 

$$A = [0, 0, 5, 10, 0, 0, 0, 23, 24]$$

Each sample occurs at a rate of $\frac{1}{N}$. Consequently, the $\cos, \sin$ functions "catch" a given sample at a precise timing which contributes to the weighting to the sum. 

For example:


The value of $10$ occurs at $n=3$ which means that the argument of the trigonometric functions at that time instant would be $\frac{2 \pi k 3}{9} = \frac{2 \pi k}{3}$.
This means that during your summation, when you are assessing how much does that particular sample contribute to a sinusoid of frequency $k$, you will be catching that sinusoid at phase $k \cdot \frac{2 \pi}{3}$. The value $10$ occurs at $n=3$ and that sample at that amplitude and position in time contributes $\cos(1 \cdot \frac{2 \pi}{3})$ to a sinusoid of frequency $k=1$, $\cos(2 \cdot \frac{2 \pi}{3})$ to a sinusoid of frequency $k=2$ and so on (and of course, respectively to the sum corresponding to $\sin$).
By isolating certain samples from $A$ to construct a $B$ vector that does not respect the relevant timings, you are altering the time instant that a $\cos,\sin$ at some frequency $k$, "catches" the sample. Very simplistically, if the sample catches the $\cos, \sin$ at a peak, it contributes $1.0$, if it catches it at a "nodal point" it contributes $0$. If you start moving the samples around without respecting their original positions in the time series, your sums are not going to be "right".


So, what do we do?

Two things:


You need to become familiar with the concepts of normalised frequency and the DFTs "frequency resolution".


The fact that you have DFT's of different lengths on its own does not permit you from comparing the two frequency distributions. All that you have to do is evaluate the shorter DFT with more points (but with the same sampling frequency). 

There is nothing stopping you from applying an "irregularly" sampled DFT as long as you also preserve the timing of the sample. That is, instead of creating a $B$ that is a vector, you need to create a $B$ that is a $N \times 2$ "vector" where the first column is the time instance that the sample occurs and the second column is the amplitude of the signal at that time instance. 


Number 2, would be the most straightforward way to get to what you are after. Another thing that you can do is to take the irregular samples and "resample" them on to a regular grid. You can do this with a number of ways but it basically boils down to interpolation. 

Hope this helps.