Factors of an integer: Difference between revisions

Content added Content deleted
m (→‎Excel : LAMBDA: (Lifted a few keywords into a different color plane by applying the syntax highlighting for LISP))
m (→‎Excel LAMBDA: Minor reduction of the main expression)
Line 2,152: Line 2,152:


(See: [https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ The LAMBDA worksheet function in Excel])
(See: [https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ The LAMBDA worksheet function in Excel])
<lang lisp>FACTORS
<lang lisp>=LAMBDA(n,
=LAMBDA(n,
IF(1 < n,
IF(1 < n,
LET(
LET(
Line 2,165: Line 2,164:
APPEND(lows)(
APPEND(lows)(
LAMBDA(x, n / x)(
LAMBDA(x, n / x)(
IF(
REVERSE(
froot <> nroot,
IF(froot <> nroot,
REVERSE(lows),
lows,
REVERSE(INIT(lows))
INIT(lows)
)
)
)
)
)