In 1961, Rankin determined the asymptotic behavior of the number Sk,q(x) of positive integers n≤x for which a given prime q does not divide σk(n), the k-th divisor sum function. By computing the associated Euler-Kronecker constant γk,q, which depends on the arithmetic of certain subfields of Q(ζq), we obtain the second order term in the asymptotic expansion of Sk,q(x). Using a method developed by Ford, Luca and Moree (2014), we determine the pairs (k,q) with (k,q−1)=1 for which Ramanujan's approximation to Sk,q(x) is better than Landau's. This entails checking whether γk,q<1/2 or not, and requires a substantial computational number theoretic input and extensive computer usage. We apply our results to study the non-divisibility of Fourier coefficients of six cusp forms by certain exceptional primes, extending and placing into a general context the earlier work of Moree (2004), who disproved several claims made by Ramanujan on the non-divisibility of the Ramanujan tau function by five such exceptional primes.