Suppose $p$ is a prime and let $\left(\frac{a}{p}\right)$ denote the Legendre symbol modulo $p$. If $a$ is not a perfect square, then one expects some cancellation in $\sum_{p<x}\left(\frac{a}{p}\right)$ as long as $x$ is large enough in terms of $a$. Meanwhile, if $a$ is a square then this is about $\pi(x)$. And so we can think of $\frac{1}{\pi(x)}\sum_ {p<x}\left(\frac{a}{p}\right)$ as an approximation to the indicator function for perfect squares. Another way to detect squares is $\sum_{d|a}\lambda(d)$ where $\lambda$ is the Liouville function. My question is: is there a nice way to relate these two quanities? Does Liouville's function have a nice "expansion" in terms of Legendre symbols?