OFFSET
1,4
FORMULA
a(n) = Sum_{d1|n, d2|n, d1<=d2} (1-[gcd(d1,d2) = 1]), where [ ] is the Iverson bracket.
EXAMPLE
a(7) = 1; (7,7)
a(8) = 6; (2,2), (2,4), (2,8), (4,4), (4,8), (8,8)
a(9) = 3; (3,3), (3,9), (9,9)
a(10) = 5; (2,2), (2,10), (5,5), (5,10), (10,10)
MATHEMATICA
Table[Sum[Sum[(1 - KroneckerDelta[GCD[i, k], 1]) (1 - Ceiling[n/k] + Floor[n/k]) (1 - Ceiling[n/i] + Floor[n/i]), {i, k}], {k, n}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jan 01 2021
STATUS
approved