All pastes #385697 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-08 01:02 UTC
rendered paste body
alias factorize {
  var %x $1, %y 2, %c, %f
  while %y <= %x {
    while !$calc(%x % %y) {
      %x = %x / %y 
      inc %c
    }                 
    if (%c) %f = $+(%f,$iif(%f,*),%y,$iif(%c > 1,^ $+ %c))
    %c =
    inc %y
  }
  return $iif(%f,%f,$1)