(defnget-divisors[num]"Returns sorted list of divisors"(for[x(range1num):when(=(modnumx)0)]x))(defncan-reduce?[numdenom]"Returns true if fraction can be reduced, otherwise false"(first(filter#(=(modnum%)0)(rest(get-divisorsdenom)))))(defnproper-fractions[denom]"Returns the number of proper fractions that
can be created with the given denominator"(count(filter#(not(can-reduce?%denom))(range1denom))))(proper-fractions1);; 0(proper-fractions2);; 1(proper-fractions5);; 5(proper-fractions15);; 8(proper-fractions25);; 20
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Clojure: