Using a sieve to find number of divisors but only for n^2
<p>Normally I use the following code to find the number of divisors up until a given n (tau function):</p>

<pre><code>L=[0 for i in range(N+1)]
for i in range(1,N+1):
    for j in range(i, N+1,i):
        L[j]+=1
print L
</code></pre>

<p>Which outputs</p>

<pre><code>[0, 1, 2, 2, 3, 2, 4, 2, 4, 3, 4]
</code></pre>

<p>But what if I want to output divisors for n^2 instead? Right now it's looking at n=0,1,2,3,4,5,6,7,8,9,10, but I want to change it so it's actually looking at 0,1,4,9,16,25,36,49,64,81,100 (no need to mess with any other numbers).</p>

<p>The output should look like:</p>

<pre><code>[0, 1, 3, 3, 5, 3, 9, 3, 7, 5, 9]
</code></pre>
