login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

The number of divisors of n that are the sum of 2 squares.
2

%I #7 Mar 08 2024 08:09:45

%S 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,

%T 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,

%U 1,4,1,8,2,4,3,3,1,4,1,10,3,4,1,3,4,2,2

%N The number of divisors of n that are the sum of 2 squares.

%H Amiram Eldar, <a href="/A371014/b371014.txt">Table of n, a(n) for n = 1..10000</a>

%F Multiplicative with a(p^e) = floor(e/2) + 1 if p == 3 (mod 4), and e+1 otherwise.

%F a(n) = A000005(n) if and only if n is in A072437.

%F a(n) = A046951(n) if and only if n is in A004614.

%F a(n) = 1 if and only if n is in A167181.

%t 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]

%o (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));}

%Y Cf. A001481, A004614, A046951, A072437, A167181, A371015.

%K nonn,easy,mult

%O 1,2

%A _Amiram Eldar_, Mar 08 2024