Factors of an integer: Difference between revisions
Content added Content deleted
Line 5,041: | Line 5,041: | ||
</pre> |
</pre> |
||
You can find the implementation of factors() and prime_factors() in builtins\pfactors.e |
You can find the implementation of factors() and prime_factors() in builtins\pfactors.e |
||
=={{header|Phixmonti}}== |
|||
<lang Phixmonti>/# Rosetta Code problem: http://rosettacode.org/wiki/Factors_of_an_integer |
|||
by Galileo, 05/2022 #/ |
|||
include ..\Utilitys.pmt |
|||
def Factors >ps |
|||
( ( 1 tps 2 / ) for tps over mod if drop endif endfor ps> ) |
|||
enddef |
|||
11 Factors |
|||
21 Factors |
|||
32 factors |
|||
45 factors |
|||
67 factors |
|||
96 factors |
|||
pstack</lang> |
|||
{{out}} |
|||
<pre> |
|||
[[1, 11], [1, 3, 7, 21], [1, 2, 4, 8, 16, 32], [1, 3, 5, 9, 15, 45], [1, 67], [1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96]] |
|||
=== Press any key to exit ===</pre> |
|||
=={{header|PHP}}== |
=={{header|PHP}}== |