Measurements of long-range azimuthal anisotropies and associated Fourier coefficients forATLAS measurements of two-particle correlations are presented for √ s = 5.02 and 13 TeV pp collisions and for √ s NN = 5.02 TeV p + Pb collisions at the LHC. The correlation functions are measured as a function of relative azimuthal angle φ, and pseudorapidity separation η, using charged particles detected within the pseudorapidity interval |η| < 2.5. Azimuthal modulation in the long-range component of the correlation function, with | η| > 2, is studied using a template fitting procedure to remove a "back-to-back" contribution to the correlation function that primarily arises from hard-scattering processes. In addition to the elliptic, cos(2 φ), modulation observed in a previous measurement, the pp correlation functions exhibit significant cos(3 φ) and cos(4 φ) modulation. The Fourier coefficients v n,n associated with the cos(n φ) modulation of the correlation functions for n = 2-4 are measured as a function of charged-particle multiplicity and charged-particle transverse momentum. The Fourier coefficients are observed to be compatible with cos(nφ) modulation of per-event singleparticle azimuthal angle distributions. The single-particle Fourier coefficients v n are measured as a function of charged-particle multiplicity, and charged-particle transverse momentum for n = 2-4. The integrated luminosities used in this analysis are, 64 nb −1 for the √ s = 13 TeV pp data, 170 nb −1 for the √ s = 5.02 TeV pp data, and 28 nb −1 for the √ s NN = 5.02 TeV p + Pb data.