function a = nested_sqrt(n)
%takes a number n and returns a
    a= (n-1)* sqrt(1+n);
    for j= n-2:-1:1
        n = n-1;
        a = (n-1)* sqrt(1+a);
    end
    
    if n == 1, a = 1; end
end
  


