Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Magic-constant/Sidef/magic-constant.sidef
Normal file
14
Task/Magic-constant/Sidef/magic-constant.sidef
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
func f(n) {
|
||||
(n+2) * ((n+2)**2 + 1) / 2
|
||||
}
|
||||
|
||||
func order(n) {
|
||||
iroot(2*n, 3) + 1
|
||||
}
|
||||
|
||||
say ("First 20 terms: ", f.map(1..20).join(' '))
|
||||
say ("1000th term: ", f(1000), " with order ", order(f(1000)))
|
||||
|
||||
for n in (1 .. 20) {
|
||||
printf("order(10^%-2s) = %s\n", n, order(10**n))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue