Count in factors: Difference between revisions
Content added Content deleted
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
(added a solution for Factor) |
||
Line 1,205: | Line 1,205: | ||
2147 = 19 * 113 |
2147 = 19 * 113 |
||
: |
: |
||
</pre> |
|||
=={{header|Factor}}== |
|||
<lang factor> |
|||
USING: math.parser math.primes.factors math.ranges ; |
|||
IN: scratchpad "1: 1" print 2 20 [a,b] [ dup pprint ": " write factors [ number>string ] map " x " join print ] each |
|||
</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 |
|||
</pre> |
</pre> |
||