I think I'm beginning to get it. Attached find my second try at a prime number generator. This one is distinguished from my first by two important differences: 1: It is written (I think) in a completly functional style 2: It actually *works*. It's pretty fast too. Running as an optimized binary on my system (Athlon @ 950mhz under FreeBSD 5.1) it can calculate the first 15104 primes (Highest is 165161) with one minute of CPU time. Thanks again for all your help!