summaryrefslogtreecommitdiff
path: root/problem49.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem49.ijs')
-rw-r--r--problem49.ijs11
1 files changed, 11 insertions, 0 deletions
diff --git a/problem49.ijs b/problem49.ijs
new file mode 100644
index 0000000..7562796
--- /dev/null
+++ b/problem49.ijs
@@ -0,0 +1,11 @@
+digits =: 10&#.^:_1
+isPrime =: 1&p:
+allPrime =: {{*./isPrime"0 y}}"1
+permutations =: {{1=+/~:/:~"1 digits"0 y}}"1
+
+offset =: 3330
+count =: 10000-2*offset
+combs =: (i.3339) +" 0 1 offset * i.3
+primeAndPerm =: allPrime *. permutations
+goodSeq =: ({: I. primeAndPerm combs) + offset * i.3
+problem49 =: 10#.,digits"0 goodSeq \ No newline at end of file