Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • There are a total of 24 solutions to the puzzle. These 24 solutions are comprised of 10 unique integers. If you do not consider the reverse of an integer unique, there are 5 unique integers. No matter which way you slice this - there is no way to get to "six integers" unless the spec is incomplete.
    • 24 solutions? how did get them? can you show them?
      • Well, first the math

        there is 1 solution for 7, with reverse = 2
        there is 3 solutions for 9, with reverse = 6
        there is 1 solution for 11, with reverse = 2

        2 * 6 * 2 = 24

        I used a bit more complicated code than I am about to show, but you should be able to see how I came up with the 24 solutions

        for my $a (1 .. 9) {
            for my $b (grep {! /$a/} 1 .. 9) {
                for my $c (grep {! /$a|$b/ 1 .. 9) {
                    my $first = join '', $a, $b, $c;
           

        • well, you said: 1 solution for 7, with reverse 2. actually - there are 2 solutions for 7 (4 with reverse).

          and your code shows them.

          also - you didn't take into consideration the fact that digits cannot be reused between numbers generated for various dividers.

          • With regards to the math: What I posted about 24 solutions comprised of 10 different integers was correct (as is my code). I made a mistake when I was explaining where I came up with the 24 solutions because I didn't have the code or the results in front of me. My apologies.

            also - you didn't take into consideration the fact that digits cannot be reused between numbers generated for various dividers

            I am not sure I understand.

            for my $a (1 .. 9) { # 1 - 9
                for my $b (grep {! /$a/} 1 .. 9) { # 1

    • I'm sure they won't publish a correction.

      Note that the spec says to find a 3-digit number which satisfies the criteria, not the 3-digit number. That there are multiple such numbers, and you could've found a different one, doesn't violate the spec.

      Once you've done what it says, you will have 3 3-digit numbers, plus their reverses. That's 6 integers.

      Yes, other people could validly come up with a different set of 6 integers. So what? There's nothing in the spec prohibiting that! As others have noted

      • I guess I won't be looking into New Scienties afterall

        Having worked on interesting puzzles like this as long as I can remember, as well as knowing many people who have the same interest - this is the type of puzzle no one likes to work on.

        A simple foot note that says: While multiple preliminary solutions are possible, the max and min will always be the same.

        Would have gone a long way to making others and myself happier that our solutions were correct.

        By the way - you have read into the spec.

        Once you've don
        • They're not usually this unclear. I think it's just a fluke, but I'd have to work through some others to be sure.