@(n,k)sum(k.^(0:n^2-1)) ans(3,6)
Standard input is empty
ans = @(n, k) sum (k .^ 0:n ^ 2 - 1) ans = 2015539
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!