OFFSET
1,2
FORMULA
a(n) = Sum_{d1|n, d2|n} sign(floor(d1*d2/n)).
a(n) = tau*(tau+2)/4 if tau is even and a(n) = (tau+1)^2/4 if tau is odd, where tau = A000005(n) is the number of divisors of n, i.e., a(n) = A002620(A000005(n)+1) = floor((A000005(n)+1)^2/4). - Chai Wah Wu, Jan 29 2021
EXAMPLE
a(4) = 4; (1,4), (2,2), (2,4), (4,4).
a(5) = 2; (1,5), (5,5).
a(6) = 6; (1,6), (2,3), (2,6), (3,3), (3,6), (6,6).
MATHEMATICA
Table[Sum[Sum[Sign[Floor[i*k/n]] (1 - Ceiling[n/k] + Floor[n/k]) (1 - Ceiling[n/i] + Floor[n/i]), {i, k}], {k, n}], {n, 100}]
PROG
(Python)
from sympy import divisor_count
def A337174(n):
return (divisor_count(n)+1)**2//4 # Chai Wah Wu, Jan 29 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jan 28 2021
STATUS
approved