#P10532. Double Summation with Coprime Indicator
Double Summation with Coprime Indicator
Double Summation with Coprime Indicator
Given a positive integer \(n\), compute the value of the double summation:
\( S = \sum_{i=1}^n \sum_{j=1}^n \left\lfloor \frac{n}{\max(i,j)} \right\rfloor \; [i \perp j] \)
where \([i \perp j]\) is an indicator that equals 1 if \(i\) and \(j\) are coprime (i.e. \(\gcd(i,j) = 1\)) and 0 otherwise.
Hint: This problem suggests the use of advanced number theory techniques such as Möbius inversion. In the process of optimizing complex summations related to divisors, the Möbius inversion formula is a key tool.
inputFormat
The input consists of a single line containing a positive integer n (\(1 \leq n \leq 10^5\)).
outputFormat
Output a single integer, the computed value of the summation \(S\).
sample
1
1