Count in factors: Difference between revisions

Content deleted Content added
Added Octave example
Line 617:
print ""
end</lang>
 
=={{header|Octave}}==
Octave's factor function returns an array:
<lang octave>for (n = 1:20)
printf ("%i: ", n)
printf ("%i ", factor (n))
printf ("\n")
endfor</lang>
 
Output:
<lang>1: 1
2: 2
3: 3
4: 2 2
5: 5
6: 2 3
7: 7
8: 2 2 2
9: 3 3
10: 2 5
11: 11
12: 2 2 3
13: 13
14: 2 7
15: 3 5
16: 2 2 2 2
17: 17
18: 2 3 3
19: 19
20: 2 2 5</lang>
 
=={{header|PARI/GP}}==