Count in factors: Difference between revisions
→{{header|Factor}}: edit whitespace, show all vocabs, style tweaks
m (→{{header|REXX}}: added closing tags ---- }} ---- for the output section template.) |
(→{{header|Factor}}: edit whitespace, show all vocabs, style tweaks) |
||
Line 1,252:
=={{header|Factor}}==
sequences ;
▲USING: math.parser math.primes.factors math.ranges ;
: .factors ( n -- )
dup pprint ": " write factors
[ " × " write ] [ pprint ] interleave nl ;
"1: 1" print 2 20 [a,b] [ .factors ] each</lang>
{{out}}
<pre>
Line 1,261 ⟶ 1,265:
2: 2
3: 3
4: 2
5: 5
6: 2
7: 7
8: 2
9: 3
10: 2
11: 11
12: 2
13: 13
14: 2
15: 3
16: 2
17: 17
18: 2
19: 19
20: 2
</pre>
|