Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,32 +1,32 @@
|
|||
isPrime = function(n)
|
||||
if n < 2 then return false
|
||||
if n < 4 then return true
|
||||
for i in range(2,floor(n ^ 0.5))
|
||||
if n % i == 0 then return false
|
||||
end for
|
||||
return true
|
||||
if n < 2 then return false
|
||||
if n < 4 then return true
|
||||
for i in range(2,floor(n ^ 0.5))
|
||||
if n % i == 0 then return false
|
||||
end for
|
||||
return true
|
||||
end function
|
||||
|
||||
countFactors = function(n)
|
||||
cnt = 0
|
||||
for i in range(2, n)
|
||||
while n % i == 0
|
||||
cnt += 1
|
||||
n /= i
|
||||
end while
|
||||
end for
|
||||
return cnt
|
||||
cnt = 0
|
||||
for i in range(2, n)
|
||||
while n % i == 0
|
||||
cnt += 1
|
||||
n /= i
|
||||
end while
|
||||
end for
|
||||
return cnt
|
||||
end function
|
||||
|
||||
isAttractive = function(n)
|
||||
if n < 1 then return false
|
||||
factorCnt = countFactors(n)
|
||||
return isPrime(factorCnt)
|
||||
if n < 1 then return false
|
||||
factorCnt = countFactors(n)
|
||||
return isPrime(factorCnt)
|
||||
end function
|
||||
|
||||
numbers = []
|
||||
for i in range(2, 120)
|
||||
if isAttractive(i) then numbers.push(i)
|
||||
if isAttractive(i) then numbers.push(i)
|
||||
end for
|
||||
|
||||
print numbers.join(", ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue