summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2021-09-16 13:42:01 +0200
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2021-09-16 13:42:01 +0200
commitffc563fa37950f15bef95cb7cae2255e41d44709 (patch)
treeb495adbd13e0909164fb45fa3daeccf43cf17446
parentb89362ab23af5ea22c607b7a41efbe697b900545 (diff)
Problem 49
-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