PRIME numbers have fascinated mathematicians for thousands of years, and several methods have been devised for calculating them. Even as you read this, super computers in American universities are working flat out to find the next highest prime number, which is probably too big to be of any use. One popular way of finding primes is to use the sieve method discovered by the ancient Greek Eratosthenes. This involves writing a list of numbers from one to any limit, for instance: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20When this process is complete, we'll be left with the prime numbers: 1 2 3 5 7 11 13 17 19Simon's version will handle a maximum list of 4000 numbers, and takes a little over two minutes to find them all. This limit of 4000 is set by the memory available on the CPC464. We now simply remove every second number after two, every third number after three, and so on. CPC COMPUTING (12-1988) ★ AMSTRAD CPC ★ DOWNLOAD ★ |
|
CPCrulez[Content Management System] v8.7-desktop/c Page créée en 549 millisecondes et consultée 870 foisL'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko. |
|
|