FWIW

a brute force for the decimal case

DB<34> sub dig { my @res= reverse split //,$_[0]; return @res,(0) x +4} DB<35> sub repeat { my %h; @h{@_}=(); return 1 if @_ > keys %h } DB<36> $d=4; $c=0; for $i (2..4) { for $x (1..10**$d) { $p = $i*$x+$ +c ; @x = dig($x); @p = dig($p); next if repeat($i,@x[0..$d-1], @p[0.. +$d]); next if $p[4]; print "($i * $x) + $c = $p \t $i \t @x[3,2,1,0] +\t@p[4,3,2,1,0]\n" }} (4 * 1738) + 0 = 6952 4 1 7 3 8 0 6 9 5 2 (4 * 1963) + 0 = 7852 4 1 9 6 3 0 7 8 5 2

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


In reply to Re: Efficient enumeration of pandigital fractions by LanX
in thread Efficient enumeration of pandigital fractions by kikuchiyo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.