Practical numbers: Difference between revisions

Add APL
m (Added Delphi reference to Pascal code)
(Add APL)
Line 19:
 
 
=={{header|APL}}==
{{works with|Dyalog APL}}
<lang APL>pract ← ∧/⍳∊(+⌿⊢×[1](2/⍨≢)⊤(⍳2*≢))∘(⍸0=⍳|⊢)</lang>
{{out}}
<lang APL> ⍸pract¨⍳333 ⍝ Which numbers from 1 to 333 are practical?
1 2 4 6 8 12 16 18 20 24 28 30 32 36 40 42 48 54 56 60 64 66 72 78 80 84 88 90 96 100 104 108 112 120 126 128 132 140 144
150 156 160 162 168 176 180 192 196 198 200 204 208 210 216 220 224 228 234 240 252 256 260 264 270 272 276 280 288
294 300 304 306 308 312 320 324 330
pract 666 ⍝ Is 666 practical?
1</lang>
=={{header|C#|CSharp}}==
<lang csharp>using System.Collections.Generic; using System.Linq; using static System.Console;
Line 53 ⟶ 63:
6666 is a practical number.
66666 is an impractical number.</pre>
 
 
=={{header|Delphi}}==
2,119

edits