Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
21
Task/Magic-constant/AppleScript/magic-constant.applescript
Normal file
21
Task/Magic-constant/AppleScript/magic-constant.applescript
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
on magic(n)
|
||||
n * (n ^ 2 + 1) / 2
|
||||
end magic
|
||||
|
||||
repeat with i from 3 to 22
|
||||
log magic(i) as integer
|
||||
end repeat
|
||||
|
||||
log magic(1003) as integer
|
||||
|
||||
on inv_magic(lower)
|
||||
set n to 3
|
||||
repeat until magic(n) > lower
|
||||
set n to n + 1
|
||||
end repeat
|
||||
return n
|
||||
end inv_magic
|
||||
|
||||
repeat with i from 1 to 20
|
||||
log inv_magic(10 ^ i)
|
||||
end repeat
|
||||
Loading…
Add table
Add a link
Reference in a new issue