Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
15
Task/Arithmetic-numbers/APL/arithmetic-numbers.apl
Normal file
15
Task/Arithmetic-numbers/APL/arithmetic-numbers.apl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
task←{
|
||||
facs ← ⍸0=⍳|⊢
|
||||
aritm ← (0=≢|+/)∘facs
|
||||
comp ← 2<(≢facs)
|
||||
aritms ← ⍸aritm¨⍳15000
|
||||
|
||||
⎕←'First 100 arithmetic numbers:'
|
||||
⎕←10 10⍴aritms
|
||||
{
|
||||
⎕←''
|
||||
⎕←'The ',(⍕⍵),'th arithmetic number: ',(⍕aritms[⍵])
|
||||
ncomps ← +/comp¨⍵↑aritms
|
||||
⎕←'Of the first ',(⍕⍵),' arithmetic numbers, ',(⍕ncomps),' are composite.'
|
||||
}¨10*3 4
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue