This is maths...
Once you understand how the algorithm works, there are instructions for coding it:
> Euclid's algorithm programming instructions
At the end I set up a challenge dealing with prime numbers You'll need to think pretty hard about that.
When you're ready for a hint about the prime numbers problem, click here.
There's a second linear search program to try:
> Second linear search programming instructions