Numbers whose count of divisors is prime: Difference between revisions

Content added Content deleted
(Added AppleScript.)
m (→‎{{header|AppleScript}}: Changed a couple of variable labels.)
Line 194: Line 194:
set row to {}
set row to {}
set counter to 0
set counter to 0
repeat with n from 2 to (limit ^ 0.5) div 1
repeat with sqrt from 2 to (limit ^ 0.5 div 1)
set sq to n * n
set n to sqrt * sqrt
if (countFactors(countFactors(sq)) = 2) then
if (countFactors(countFactors(n)) = 2) then
set counter to counter + 1
set counter to counter + 1
set row's end to (inset & sq)'s text -maxLen thru -1
set row's end to (inset & n)'s text -maxLen thru -1
if ((count row) = 10) then
if ((count row) = 10) then
set output's end to join(row, " ")
set output's end to join(row, " ")