A371014 The number of divisors of n that are the sum of 2 squares.
1, 2, 1, 3, 2, 2, 1, 4, 2, 4, 1, 3, 2, 2, 2, 5, 2, 4, 1, 6, 1, 2, 1, 4, 3, 4, 2, 3, 2, 4, 1, 6, 1, 4, 2, 6, 2, 2, 2, 8, 2, 2, 1, 3, 4, 2, 1, 5, 2, 6, 2, 6, 2, 4, 2, 4, 1, 4, 1, 6, 2, 2, 2, 7, 4, 2, 1, 6, 1, 4, 1, 8, 2, 4, 3, 3, 1, 4, 1, 10, 3, 4, 1, 3, 4, 2, 2
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[p_, e_] := If[Mod[p, 4] == 3, Floor[e/2] + 1, e + 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
-
PARI
a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 1]%4 == 3, f[i, 2]\2 + 1, f[i, 2] + 1));}