Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Tau-function/AppleScript/tau-function-1.applescript
Normal file
24
Task/Tau-function/AppleScript/tau-function-1.applescript
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
on factorCount(n)
|
||||
if (n < 1) then return 0
|
||||
set counter to 2
|
||||
set sqrt to n ^ 0.5
|
||||
if (sqrt mod 1 = 0) then set counter to 1
|
||||
repeat with i from (sqrt div 1) to 2 by -1
|
||||
if (n mod i = 0) then set counter to counter + 2
|
||||
end repeat
|
||||
|
||||
return counter
|
||||
end factorCount
|
||||
|
||||
-- Task code:
|
||||
local output, n, astid
|
||||
set output to {"Positive divisor counts for integers 1 to 100:"}
|
||||
repeat with n from 1 to 100
|
||||
if (n mod 20 = 1) then set end of output to linefeed
|
||||
set end of output to text -3 thru -1 of (" " & factorCount(n))
|
||||
end repeat
|
||||
set astid to AppleScript's text item delimiters
|
||||
set AppleScript's text item delimiters to ""
|
||||
set output to output as text
|
||||
set AppleScript's text item delimiters to astid
|
||||
return output
|
||||
6
Task/Tau-function/AppleScript/tau-function-2.applescript
Normal file
6
Task/Tau-function/AppleScript/tau-function-2.applescript
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
"Positive divisor counts for integers 1 to 100:
|
||||
1 2 2 3 2 4 2 4 3 4 2 6 2 4 4 5 2 6 2 6
|
||||
4 4 2 8 3 4 4 6 2 8 2 6 4 4 4 9 2 4 4 8
|
||||
2 8 2 6 6 4 2 10 3 6 4 6 2 8 4 8 4 4 2 12
|
||||
2 4 6 7 4 8 2 6 4 8 2 12 2 4 6 6 4 8 2 10
|
||||
5 4 2 12 4 4 4 8 2 12 4 6 4 4 4 12 2 6 6 9"
|
||||
Loading…
Add table
Add a link
Reference in a new issue