in reply to Re: Efficient enumeration of pandigital fractions
in thread Efficient enumeration of pandigital fractions

Thanks!

Nice ideas here and elsewhere!

One nitpick: your rule 3 (that the last multiplication can't have a carry so that the numerator is base/2 - 1 digits long) doesn't mean that i < n/2, it's e (the first digit of the denominator) that has to be < n/2. i can't be 1, base/2, base-2 and base-1 (and possibly others are excluded for certain bases).

Replies are listed 'Best First'.
Re^3: Efficient enumeration of pandigital fractions
by LanX (Saint) on Jul 21, 2018 at 21:24 UTC
    > doesn't mean that i < n/2, it's e

    yeah I noticed. :)

    > i can't be 1, base/2, base-2 and base-1

    Why not base-2 ... could you elaborate?

    8 * 12.. = 96.. base-10 ?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Why not base-2 ... could you elaborate?

      8 * 1234 (the smallest possible denominator) = 9872, which is just 4 away from the largest possible numerator, 9876, so there isn't much wiggle room there. But 8 is already taken, and the next possible combination 9765, is not divisible with 8, and the quotient is less than 1234.

      In general, zyxw...(base/2-1) - (base-2) * 1234...(base/2-1) = base/2 - 1.