Let the matrix $A=[a_{ij}]_{n×n}$ be defined by $a_{ij}=\gcd(i,j )$. How prove that $A$ is invertible, and compute $\det(A)$? Let $A=[a_{ij}]_{n×n}$ be the matrix defined by letting $a_{ij}$ be the rational number such that $$a_{ij}=\gcd(i,j ).$$ How prove that $A$ is invertible, and compute $\det(A)$? thanks in advance 
 A: This is a nice result. We have
 $$ \det(A)= \phi(1)\phi(2)\dots\phi(n), $$
where $\phi$ is Euler's phi function, $\phi(n)$ being the number of positive integers $i\le n$ that are relatively prime with $n$. It satisfies 
 $$ \sum_{j\mid n}\phi(j)=n, $$
which we use below.
Let's write $a_n$ for the determinant of the $n\times n$ version of $A$. The sequence $a_1,a_2,a_3,\dots$ begins $$ 1, 1, 2, 4, 16, 32, 192, \dots $$
which OEIS catalogs as $A001088$. 
A cute short proof that only uses basic linear algebra (LDU decomposition) appears in a recent note,

Warren P. Johnson. An $LDU$ Factorization in Elementary Number Theory, Math. Mag. 76 (5), (2003), 392–394. MR1573717.

What one shows is that 
 $$ A=L\Phi L^T $$ where $L$ is the $n\times n$ matrix whose $i,j$ entry 
is $1$ if $j$ divides $i$, and is $0$ otherwise, and $\Phi$ is the diagonal matrix whose $i,i$ entry is $\phi(n)$. Note that $L$ is lower diagonal, with $1$s as entries along its main diagonal, so $\det(L)=\det(L^T)=1$, and the result follows once we prove that $A=L\Phi L^T$, as claimed. Johnson calls this Le Paige's result, who established it to compute $\det(A)$ (originally found by H. J. S. Smith around 1875, according to the references at the OEIS site).
To prove Le Paige's result, simply expand $L\Phi L^T$, and note that its $i,j$ entry is
 $$ \sum_{k=1}^n L_{ik}\Phi_{kk}(L^T)_{kj}=\sum_{k=1}^n L_{ik}\phi(k) L_{jk}=\sum_{k\mid i,k\mid j}\phi(k) =\sum_{k|{\rm gcd}(i,j)} \phi(k)={\rm gcd}(i,j)=A_{ij}, $$
where I use $B_{ij}$ to denote the $i,j$ entry of the matrix $B$.
A: There is a general trick that applies to this case.
Assume a matrix $A=(a_{i,j})$ is such that there exists a function $\psi$ such that
$$
a_{i,j}=\sum_{k|i,k|j}\psi(k)
$$
for all $i,j$.
Then 
$$
\det A=\psi(1)\psi(2)\cdots\psi(n).
$$
To see this, consider the matrix $B=(b_{i,j})$ such that $b_{i,j}=1$ if $i|j$ and $b_{i,j}=0$ otherwise. Note that $B$ is upper-triangular with ones on the diagonal, so its determinant is $1$. 
Now let $C$ be the diagonal matrix whose diagonal is $(\psi(1),\ldots,\psi(n))$.
A matrix product computation shows that 
$$
A=B^tCB\quad\mbox{hence}\quad \det A=(\det B)^2\det C=\psi(1)\cdots\psi(n).
$$
Now going back to your question.
Consider Euler's totient function $\phi$.
It is well-known that
$$
m=\sum_{k|m}\phi(k)
$$
so
$$
a_{i,j}=gcd(i,j)=\sum_{k|gcd(i,j)}\phi(k)=\sum_{k|i,k|j}\phi(k).
$$
Applying the general result above, we find:
$$
\det A=\phi(1)\phi(2)\cdots\phi(n).
$$
A: Let $F\colon \{1, \ldots, n\}\to \mathbb{R}$ be a function.  The $n\times n$ matrix $A=(a_{ij}) = (F(\gcd(i.j)))$ is symmetric. It it possible to give its Cholesky decomposition. Indeed, let $g\colon \{ 1, \ldots, n\}\to \mathbb{R}$ such that
$$F(m) = \sum_{d \mid m} G(d)$$
The function $g$ is uniquely determined by the equation
$$G(m) = \sum_{d\mid m} \mu(d) F(\frac{m}{d})$$F
where $\mu$ is the Mobius function. We have
$$F(\gcd(i.j)) = \sum_{d=1}^n u_{d i} u_{d j}\, G(d)$$
where $u_{d i} = 1$ if $d\mid i$ and $0$ otherwise.
We see that we have the equality
$$A = U^t \cdot D \cdot U$$
where $U$ is the upper triangular matrix $(u_{ij})$, and $D$ is the diagonal matrix $(G(1), \ldots, G(n))$.
We conclude that $\det A= G(1) \cdots G(n)$.
Note: if $F(m) = m^{\alpha}$, with $\alpha > 0$, then $G(m)$ is always positive ( easy to see using the Mobius inversion formula). We conclude that all the Hadamard positive powers of the matrix $A$ are positive definite, with determinants that can be calculated explicitly.
This method works for other partial orders on the set $\{1, \ldots, n\}$, in particular the standard order. The bordered determinants are therefore easy to calculate.
