Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Anti-primes/BCPL/anti-primes.bcpl
Normal file
24
Task/Anti-primes/BCPL/anti-primes.bcpl
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
get "libhdr"
|
||||
manifest $( LIMIT = 20 $)
|
||||
|
||||
let nfactors(n) =
|
||||
n < 2 -> 1, valof
|
||||
$( let c = 2
|
||||
for i=2 to n/2
|
||||
if n rem i = 0 then c := c + 1
|
||||
resultis c
|
||||
$)
|
||||
|
||||
let start() be
|
||||
$( let max = 0 and seen = 0 and n = 1
|
||||
while seen < LIMIT
|
||||
$( let f = nfactors(n)
|
||||
if f > max
|
||||
$( writef("%N ",n)
|
||||
max := f
|
||||
seen := seen + 1
|
||||
$)
|
||||
n := n + 1
|
||||
$)
|
||||
wrch('*N')
|
||||
$)
|
||||
Loading…
Add table
Add a link
Reference in a new issue