From f9678673dfa11d3b793676350e01247024e803b3 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Fri, 27 Aug 2021 23:51:34 +0200 Subject: Problem 37 --- problem37.ijs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 problem37.ijs (limited to 'problem37.ijs') diff --git a/problem37.ijs b/problem37.ijs new file mode 100644 index 0000000..bebb9de --- /dev/null +++ b/problem37.ijs @@ -0,0 +1,7 @@ +enc =: 10&#. +digits =: enc^:_1 +truncs =: monad : '(1-#y)+i._1+2*#y' +truncations =: monad : '; enc@:}.&y each truncs y' +truncatablePrime =: monad : '*./1&p: truncations digits y'"0 +primes =: 4}.p:i.1e5 NB. A good guess :) +problem37 =: +/(truncatablePrime#]) primes -- cgit v1.2.3