In 1961, Rankin determined the asymptotic behavior of the number S k,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 S k,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 S k,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 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.