Arithmetic numbers: Difference between revisions

m
→‎{{header|AppleScript}}: Minor refinement for input < 4.
(Added AppleScript.)
m (→‎{{header|AppleScript}}: Minor refinement for input < 4.)
Line 291:
=={{header|AppleScript}}==
<syntaxhighlight lang="applescript">on isArithmetic(n)
if (n < 24) then return {arithmetic:(n = 1), composite:false}
if (n < 0) then return {arithmetic:false, composite:missing value}
return {arithmetic:(n mod 2 = 1), composite:false}
end if
set factorSum to 1 + n
set factorCount to 2
557

edits