From ffc563fa37950f15bef95cb7cae2255e41d44709 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 16 Sep 2021 13:42:01 +0200 Subject: Problem 49 --- problem49.ijs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 problem49.ijs 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 -- cgit v1.2.3