RosettaCodeData/Task/Magic-constant/11l/magic-constant.11l

18 lines
322 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
F a(=n)
n += 2
R n * (n ^ 2 + 1) / 2
F inv_a(x)
V k = 0
L k * (k ^ 2.0 + 1) / 2 + 2 < x
k++
R k
print(The first 20 magic constants are:)
L(n) 1..19
print(Int(a(n)), end' )
print("\nThe 1,000th magic constant is: "Int(a(1000)))
L(e) 1..19
print(10^e: inv_a(10.0 ^ e))