Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
is_prime = (n) ->
|
||||
# simple prime detection using trial division, works
|
||||
# for all integers
|
||||
return false if n <= 1 # by definition
|
||||
p = 2
|
||||
while p * p <= n
|
||||
return false if n % p == 0
|
||||
p += 1
|
||||
true
|
||||
|
||||
for i in [-1..100]
|
||||
console.log i if is_prime i
|
||||
Loading…
Add table
Add a link
Reference in a new issue