We prove asymptotic formulae for sums of the form
$$\sum\limits_{n\in {\open z}^d\cap K} {\prod\limits_{i = 1}^t {F_i} } (\psi _i(n)),$$ where K is a convex body, each Fi is either the von Mangoldt function or the representation function of a quadratic form, and Ψ = (ψ1, …, ψt) is a system of linear forms of finite complexity. When all the functions Fi are equal to the von Mangoldt function, we recover a result of Green and Tao, while when they are all representation functions of quadratic forms, we recover a result of Matthiesen. Our formulae imply asymptotics for some polynomial patterns in the primes. For instance, they describe the asymptotic behaviour of the number of k-term arithmetic progressions of primes whose common difference is a sum of two squares.
The paper combines ingredients from the work of Green and Tao on linear equations in primes and that of Matthiesen on linear correlations amongst integers represented by a quadratic form. To make the von Mangoldt function compatible with the representation function of a quadratic form, we provide a new pseudorandom majorant for both – an average of the known majorants for each of the functions – and prove that it has the required pseudorandomness properties.