For each coordinate:

- Convert the ordered pair (a,b) to the expression a+bi.
- Square it, then add a+bi again.
- Repeat step 2 until…
- the absolute value exceeds 2 (no draw), or
- the number of iterations passes a specified number (draw).

I wrote a flexible program that produces the image you see here:

(Note: I used an emulator to render it. Be kind to your batteries!)

```
PROGRAM:MANDEL
:FnOff
:ClrHome
:ClrDraw
:GridOff
:AxesOff
:PlotsOff
:-2→Xmin
:1→Xmax
:-1→Ymin
:1→Ymax
:For(A,-2,1,ΔX
:For(B,0,1,ΔY
:200→I
:A+Bi→C
:While 2I≥abs(Ans
:DS<(I,1
:Ans²+C
:End
:If not(I
:Then
:Pt-On(A,B
:Pt-On(A,-B
:End
:End
:End
```

Use different coefficients for ΔX/ΔY to change the resolution of the image, and plug in a different value for I to set the number of iterations. (More iterations = better approximation of the fractal.) If you want to pan and zoom by changing the window settings, know that the symmetry of the drawing will break down, so you should make these other changes as well:

```
:For(A,-2,1,ΔX
:For(B,0,1,ΔY
```

…into…

```
:For(A,Xmin,Xmax,ΔX
:For(B,Ymin,Ymax,ΔY
```

…and…

```
:If not(I
:Then
:Pt-On(A,B
:Pt-On(A,-B
:End
:End
:End
```

…into…

```
:If not(I
:Pt-On(A,B
:End
:End
```

(making sure to leave just two Ends at the bottom of the program).

Halving the tolerance (by removing the 2 from the While), and storing 100 to I, and using these window settings…

```
Xmin=-0.67058
Xmax=-0.67008
Ymin=-0.4582
Ymax=-0.4577
```

…got me this:

Courtesy of: http://www.cs.princeton.edu/~wayne/mandel/gallery/

I shall play around some more with this. :)