APPLICATIONSDIVERS ★ SIEVE OF ERATOSTHENES (CPC COMPUTING) ★

Sieve of Eratosthenes (CPC Computing)Applications Divers
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

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 20

When this process is complete, we'll be left with the prime numbers:

1 2 3 5 7 11 13 17 19

Simon'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)

★ PUBLISHER: CPC COMPUTING
★ YEAR: 1988
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1988
★ AUTHOR: Simon Benge
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Sieve  of  Eratosthenes    (CPC  Computing)    ENGLISHDATE: 2020-08-15
DL: 192
TYPE: ZIP
SiZE: 4Ko
NOTE: Typed by Nicholas CAMPBELL ; 40 Cyls
.HFE: Χ

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Test de Joysticks (Amstrad User)
» Applications » Accelerateur (CPC Revue)
» Applications » Compilation : Demon PD - PD 14 - DW Software 2
» Applications » Téléchargement Star/Arcades Star
» Applications » Mudança de Base (Amstrad Magazine)
» Applications » Tapecleaner (CPC Magazin)
Je participe au site:
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 549 millisecondes et consultée 870 fois

L'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.