Discrete Cosine Transform (DCT)
I can't recall which type of DCT your formula refers to, but assuming the formula is right, then the summation in the first equation computes $N$ coefficients of the DCT sequence $F[k]$ of the $N$-point input sequence $x[n]$. A similar interpretation applies to the inverse formula.
The following Matlab/Octave code implements the first formula:
N = 6;              % length of input sequence x[n], and output sequence F[k]
x = [1,0,2,5,3,7];  % the input

F = zeros(1,N);     % the output: DCT coeffs

for k = 0 :N-1
    csum = 0;
    for n = 0: N-1
        csum = csum + 2*x(n+1)*cos((pi/(2*N))*k*(2*n+1));
    end
    F(k+1) = csum;
end