• 0

Shuffle to Double

Question

Posted · Report post

Search for the smallest positive integer that if you shuffle its digits its new value becomes double.

0

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted (edited) · Report post

Search for the smallest positive integer that if you shuffle its digits its new value becomes double.

0

Edited by BMAD
0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

0 is not a positive integer.

24.

0

Share this post


Link to post
Share on other sites
  • 0

Posted (edited) · Report post

0 is not a positive integer.

24.

darn. This is why i prefer to write my own questions. I am always making simple mistakes like this.

42 is not double of 24 :P

Edited by BMAD
0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Search for the smallest positive integer that if you shuffle its digits its new value becomes double.

clarification

is it going to be double regardless how it is shuffled or that there exists a double if shuffled the correct way"

0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

125874...can be shuffled to be 251748

0

Share this post


Link to post
Share on other sites
  • 0

Posted (edited) · Report post

Just validated my above answer with a simple program...in case you're curious, here's the source:

public class SuffleDouble {
   public static void main(String[] args) {
      for (long i = 1; i < 1000000; i++) {
         permutation("", i + "", i);
      }
   }
 
   private static void permutation(String prefix, String str, long origVal) {
      int n = str.length();
      if (n == 0) {
         long newVal = Long.parseLong(prefix);
         if (origVal * 2 == newVal) {
            System.out.println(origVal + " * 2 = " + prefix);
            System.exit(0);
         }
      } else {
         for (int i = 0; i < n; i++) {
            permutation(prefix + str.charAt(i), str.substring(0, i) + str.substring(i+1, n), origVal);
         }
      }
   }
}

Edited by Pickett
0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I was considering Kevink2's number 285714 from BMAD's 50% Increase problem to render 571428 , but hoping for much smaller number . Yet the 6 digits shows up again...."125874...can be shuffled to be 251748" matched with code. What other properties these 6digit combo has? Thanks for convincing solve Pickett..

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.