  For any measure preserving system $(X,\mathcal{X},\mu,T)$ and
$A\in\mathcal{X}$ with $\mu(A)>0$, we show that there exist infinitely many
primes $p$ such that $\mu\bigl(A\cap T^{-(p-1)}A\cap T^{-2(p-1)}A\bigr) > 0$
(the same holds with $p-1$ replaced by $p+1$). Furthermore, we show the
existence of the limit in $L^2(\mu)$ of the associated ergodic average over the
primes. A key ingredient is a recent result of Green and Tao on the von
Mangoldt function. A combinatorial consequence is that every subset of the
integers with positive upper density contains an arithmetic progression of
length three and common difference of the form $p-1$ (or $p+1$) for some prime
$p$.
