The first approach to compute DFT directly using the definition can't be correct because there is no summation over n. Try it this way. First off there really isn't a need to define a function to compute fn.
fn = 100*exp(2i*pi*67*n/N);
Now define a function to compute the DFT for a given value of k
dftfn = @(k,fn,n,N) (sum(fn .* exp(-1i*2*pi*k*n/N))/N);
Now test for a couple of values of k
The next step would be to write a loop to evaluate dftfn at the values of k of interest.
Note: there are other alternatives, but I think this is the clearest.
For the second approach, I don't think the closed form expression is correct. There shoudn't be an n in any term.
fk_func = @(k,N) (100/N).*((1-exp(2i.*pi.*(67-k)))./(1-exp(2i.*pi.*(67-k)./N)));
As expected all the reults are tiny, but what happened at k = 67?
We see that there is a gap, because the formula at k = 67 yields NaN because it evaluates to 0/0.