Skip to content

Instantly share code, notes, and snippets.

View hamukazu's full-sized avatar

Kimikazu Kato hamukazu

View GitHub Profile
(require 'clojure.set)
(defn perms [n s]
(if (zero? n) '(())
(reduce (fn [x y] (let [m (dec n) ss (clojure.set/difference s #{y})]
(concat x (map (fn [z] (cons y z)) (perms m ss)))))
() s)))
(defn solv [a]
(def b (vec a))
(def appeared (set a))
@hamukazu
hamukazu / 6digitprimes.py
Created November 4, 2013 01:35
To show the number of 6 digit prime numbers
ps=[]
def pre():
f=[True]*1000
for i in xrange(2,1000):
if f[i]:
ps.append(i)
j=i
while j<1000: