From f5e11ad373e9220578b05d5adcda0c516d7a1091 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Wed, 2 Mar 2022 21:05:46 +0100 Subject: Solve problem 99 --- problem99.ijs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 problem99.ijs (limited to 'problem99.ijs') diff --git a/problem99.ijs b/problem99.ijs new file mode 100644 index 0000000..0c7de2a --- /dev/null +++ b/problem99.ijs @@ -0,0 +1,9 @@ +NB. The trick is to convert numbers to a common base using +NB. a^b = e^(b * ln(a)), so by comparing the exponents we +NB. avoid calculating the large number + +solve =: {{ + >:{.\:{{y*^.x}}/|:1000 2$".>{.|:2000 2$;:fread y +}} + +problem99 =: solve 'p099_base_exp.txt' -- cgit v1.2.3