Octave, 67 bytes
@(x)~any(diff(find(h=histc(factor(x),primes(x))))-1)&h(h>0)==max(h)
I believe this is the only solution that uses a histogram. I don't like unexplained answers, so here goes:
Explanation:
This makes a histogram, where the variable to be counted are the factors of the input, and placed in the bins primes(x)
, which is all primes less than the input. We then find the location of the prime factors, takes the difference between each of the indices and subtract one. If there are any elements that aren't zero (i.e. the difference of the indices of prime numbers is not 1), then this will result in a falsy value, otherwise it will return a truthy value.
We then chech that all non-zero elements in the histogram are equal to the maximum element. If there are values that aren't equal then this will result in a falsy value, otherwise it will return a truthy value.
If both those blocks are truthy then our input is a consecutive prime constant exponent number!