15 lines
429 B
Text
15 lines
429 B
Text
F left_fact(n)
|
||
BigInt result = 0
|
||
BigInt factorial = 1
|
||
L(i) 1 .. n
|
||
result += factorial
|
||
factorial *= i
|
||
R result
|
||
|
||
print(‘First 11 left factorials:’)
|
||
print((0..10).map(i -> left_fact(i)))
|
||
print("\n20 through 110 (inclusive) by tens:")
|
||
L(i) (20..110).step(10)
|
||
print(left_fact(i))
|
||
print("\nDigits in 1,000 through 10,000 by thousands:")
|
||
print((1000..10000).step(1000).map(i -> String(left_fact(i)).len))
|