Anonymous user
Amicable pairs: Difference between revisions
Using Sieve of Eratosthenes module
(Added solution for Action!) |
(Using Sieve of Eratosthenes module) |
||
Line 264:
=={{header|Action!}}==
Calculations on a real Atari 8-bit computer take quite long time. It is recommended to use an emulator capable with increasing speed of Atari CPU.
{{libheader|Action! Sieve of Eratosthenes}}
<lang Action!>DEFINE MAXNUM="20000"▼
<lang Action!>INCLUDE "H6:SIEVE.ACT"
BYTE ARRAY primes(MAXNUM+1)▼
SetBlock(primes,MAXNUM+1,1)▼
CARD FUNC SumDivisors(CARD x)
Line 303 ⟶ 286:
PROC Main()
▲ BYTE ARRAY primes(MAXNUM+1)
CARD m,n
Put(125) PutE() ;clear the screen
FOR m=1 TO MAXNUM-1
DO
|