 be a positive integer. A Nordic square is an
 be a positive integer. A Nordic square is an  board containing all the integers from
 board containing all the integers from  to
 to  so that each cell contains exactly one number. Two different cells are considered adjacent if they share a common side. Every cell that is adjacent only to cells containing larger numbers is called a valley. An uphill path is a sequence of one or more cells such that:
 so that each cell contains exactly one number. Two different cells are considered adjacent if they share a common side. Every cell that is adjacent only to cells containing larger numbers is called a valley. An uphill path is a sequence of one or more cells such that:(i) the first cell in the sequence is a valley,
(ii) each subsequent cell in the sequence is adjacent to the previous cell, and
(iii) the numbers written in the cells in the sequence are in increasing order.
Find, as a function of
 , the smallest possible total number of uphill paths in a Nordic square.
, the smallest possible total number of uphill paths in a Nordic square. such pairs, and the cell containing
 such pairs, and the cell containing  uphill paths.
 uphill paths. cells such that every cell not in the tree is only adjacent to cells in the tree. A diagram of such a tree for
 cells such that every cell not in the tree is only adjacent to cells in the tree. A diagram of such a tree for  is given below; this readily generalizes to any multiple of
 is given below; this readily generalizes to any multiple of  ,
, to
 to ![[asy]
unitsize(16);
for(int i=0; i < 10; i=i+2) {
 fill((0,i)--(3,i)--(3,i+1)--(0,i+1)--cycle,grey);
 fill((6,i)--(9,i)--(9,i+1)--(6,i+1)--cycle,grey);
}
for(int i=1; i < 9; i=i+2) {
 fill((3,i)--(6,i)--(6,i+1)--(3,i+1)--cycle,grey);
}
for(int i=1; i < 10; i=i+3) {
 fill((i,1)--(i,9)--(i+1,9)--(i+1,1)--cycle,grey);
}
fill((3,0)--(4,0)--(4,1)--(3,1)--cycle,grey);
fill((5,0)--(6,0)--(6,1)--(5,1)--cycle,grey);
for(int i=0; i < 10; ++i) {
 draw((i,0)--(i,9));
 draw((0,i)--(9,i));
}
[/asy]](https://latex.artofproblemsolving.com/e/7/b/e7bdb73c40e09cf655928624d8ec893b0044ea00.png)