note: Mathematica reserves capital letters to itself so variable names
like N or D are disallowed:
Set::wrsym: Symbol D is Protected.

n=2
d=4.5
lambda=.580
Plot[(Sin[ Pi n (d/lambda) (y/Sqrt[4^2+y^2])]/Sin[ Pi (d/lambda) (y/Sqrt[4^2+y^2])])^2,{y,-1,1}]
Export["slits2.pdf",%]

n=4
Plot[(Sin[ Pi n (d/lambda) (y/Sqrt[4^2+y^2])]/Sin[ Pi (d/lambda) (y/Sqrt[4^2+y^2])])^2,{y,-1,1}]
Export["slits4.pdf",%]

n=16
Plot[(Sin[ Pi n (d/lambda) (y/Sqrt[4^2+y^2])]/Sin[ Pi (d/lambda) (y/Sqrt[4^2+y^2])])^2,{y,-1,1},PlotRange->All]
Export["slits16.pdf",%]

