%[VideoFileName,VideoPathName] = uiputfile ('*.*','');

for N=18:2:40,
hf = figure();
plot([0 0 N N 0],[0 N N 0 0]);hold on;
IntegersX = [];
IntegersY = [];
for i=1:2:N,


    Odd2 = N - i;
    plot([0 0 i i 0],[N-i N N N-i N-i]);hold on;
    plot([i i N N i],[0 N-i N-i 0 0]);hold on;
    Xs = 1:i;
    Ys = i./Xs;
    XsBig = 1:N;
    YsBig = (N-i)./XsBig;
    Xs = i-Xs;
    Ys = Ys + N-i;
    XsBig = XsBig + i;
    YsBig = N-i-YsBig;
    plot(Xs,Ys);hold on;
    plot(XsBig,YsBig);hold on;
    IntegersX(end+1:end+length(Xs((mod(Ys,1) < 0.001)))) = Xs((mod(Ys,1) < 0.001));
    IntegersY(end+1:end+length(Ys((mod(Ys,1) < 0.001)))) = Ys((mod(Ys,1) < 0.001));
    IntegersX(end+1:end+length(XsBig((mod(YsBig,1) < 0.001)))) = XsBig((mod(YsBig,1) < 0.001));
    IntegersY(end+1:end+length(YsBig((mod(YsBig,1) < 0.001)))) = YsBig((mod(YsBig,1) < 0.001));
    plot([0 N], [N/2 + 1, -N*0.5+1 + N/2],'r-');
plot([0, N], [N - 1, -N*0.5-1 + N],'r-');
plot(IntegersX,IntegersY,'Marker','o','MarkerFaceColor',[0 1 0],'LineStyle','none');
set(gca,'XLim',[0 N],'YLim',[0 N]);
    %plot([N N N-i N-i N],[N N-i N-i N N]);hold on;
end
%print(hf, strcat(VideoPathName, num2str(N), '.tif'), '-dtiff');
%delete(gcf);
end