Count in factors: Difference between revisions

Added Arturo implementation
m (Added Delphi reference to Pascal code)
(Added Arturo implementation)
Line 687:
Number 2144 : 2 2 2 2 2 67
</pre>
=={{header|Arturo}}==
 
<lang rebol>loop 1..30 'x [
fs: [1]
if x<>1 -> fs: factors.prime x
print [pad to :string x 3 "=" join.with:" x " to [:string] fs]
]</lang>
 
{{out}}
 
<pre> 1 = 1
2 = 2
3 = 3
4 = 2 x 2
5 = 5
6 = 2 x 3
7 = 7
8 = 2 x 2 x 2
9 = 3 x 3
10 = 2 x 5
11 = 11
12 = 2 x 2 x 3
13 = 13
14 = 2 x 7
15 = 3 x 5
16 = 2 x 2 x 2 x 2
17 = 17
18 = 2 x 3 x 3
19 = 19
20 = 2 x 2 x 5
21 = 3 x 7
22 = 2 x 11
23 = 23
24 = 2 x 2 x 2 x 3
25 = 5 x 5
26 = 2 x 13
27 = 3 x 3 x 3
28 = 2 x 2 x 7
29 = 29
30 = 2 x 3 x 5</pre>
 
=={{header|AutoHotkey}}==
{{trans|D}}
1,532

edits