login
Number of pairs (d1,d2) of divisors of n such that d1 < d2 and d2^2 + d1*(n - d2)^2 = n^2.
0

%I #6 May 19 2021 23:51:50

%S 0,1,1,2,1,3,1,3,2,3,1,7,1,3,3,4,1,7,1,5,3,3,1,9,2,3,3,5,1,9,1,5,3,3,

%T 3,10,1,3,3,7,1,9,1,5,5,3,1,11,2,5,3,5,1,9,3,7,3,3,1,13,1,3,5,6,3,9,1,

%U 5,3,7,1,13,1,3,5,5,3,9,1,9,4,3,1,13,3,3,3,7,1,13

%N Number of pairs (d1,d2) of divisors of n such that d1 < d2 and d2^2 + d1*(n - d2)^2 = n^2.

%C If p is prime, then a(p) = 1. The only pair of divisors (d1,d2) of p such that d1 < d2 is (1,p), and since p^2 + 1*(p - p)^2 = p^2, (1,p) is the only solution.

%F a(n) = Sum_{d1|n, d2|n, d1<d2} [d2^2 + d1*(n - d2)^2 = n^2], where [ ] is the Iverson bracket.

%e a(12) = 7; The 7 pairs are (1,12), (2,4), (2,12), (3,6), (3,12), (4,12), (6,12).

%t Table[Sum[Sum[KroneckerDelta[k^2 + i*(n - k)^2, n^2] (1 - Ceiling[n/k] + Floor[n/k]) (1 - Ceiling[n/i] + Floor[n/i]), {i, k - 1}], {k, n}], {n, 100}]

%K nonn

%O 1,4

%A _Wesley Ivan Hurt_, May 19 2021