From 6fcb28bbf34fc81f40592eaa71cf2b8afbfd126d Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Fri, 27 Aug 2021 19:16:00 +0200 Subject: Problem 33 --- problem33.ijs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 problem33.ijs diff --git a/problem33.ijs b/problem33.ijs new file mode 100644 index 0000000..fedc030 --- /dev/null +++ b/problem33.ijs @@ -0,0 +1,12 @@ +digits =. 10&#.^:_1 +funny =. dyad define"0 + f =. x%y + 'n1 n2' =. digits x + 'd1 d2' =. digits y + cross1 =. (n2 = d1) *. f = n1%d2 + cross2 =. (n1 = d2) *. f = n2%d1 + (1,f){~ cross1+.cross2 +) +pairs =. ,funny/~x:10+i.90 +fractions =. ;pairs#~1>pairs +problem33 =: {: 2 x: */fractions -- cgit v1.2.3