function r=VonNeumann(n)
% r=VonNeumann(n) generates n random numbers using "middle-square"
% method

% mms 3/26/14

x=1234567890;
r(n)=0;
for i=1:n
  newseed = mod(round(x/1000),1000000);
  r(i)=newseed;
  x=newseed^2;
end
