Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 2015-04-27 17:42:10

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Yes...{1,615}, {3,205}, {5,123}, {15,41}.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#27 2015-04-27 17:51:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

Starting with the first one:

It is reasonable to say,


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#28 2015-04-27 17:58:10

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Yes, the deducted x option will give a smaller result for a non-negative x.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#29 2015-04-27 18:00:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

Solve for k and x.

NSolve[{(2^k + x) == 615, (2^k - x) == 1}, {x, k}, Reals, WorkingPrecision -> 50]

What do you conclude?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#30 2015-04-27 18:07:10

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Done. k must be an integer, so that is not a solution.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#31 2015-04-27 18:12:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

I am sorry I inadvertently used k instead of n, let us go back to n and x as our variables. Check the whole calculation out now:

NSolve[{(2^n + x) == 615, (2^n - x) == 1}, {x, n}, Reals, WorkingPrecision -> 50]
NSolve[{(2^n + x) == 205, (2^n - x) == 3}, {x, n}, Reals, WorkingPrecision -> 50]
NSolve[{(2^n + x) == 123, (2^n - x) == 5}, {x, n}, Reals, WorkingPrecision -> 50]
NSolve[{(2^n + x) == 41, (2^n - x) == 15}, {x, n}, Reals, WorkingPrecision -> 50]

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#32 2015-04-27 18:32:47

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Ok...got it.

{{x -> 307.0000000000000000000000000000000000000000000000, 
  n -> 8.2667865406949013636413323639576237673442581516479}}

{{x -> 101.00000000000000000000000000000000000000000000000, 
  n -> 6.7004397181410921603968126542566947336284364017910}}

{{x -> 59.00000000000000000000000000000000000000000000000, 
  n -> 6.0000000000000000000000000000000000000000000000000}}

{{x -> 13.000000000000000000000000000000000000000000000000, 
  n -> 4.8073549220576041074419693172318308086410266259661}}

What was confusing me from your post #2 code was 'ConditionalExpression' and most of the expression's content:

I've never done imaginary numbers and the epsilon is foreign to me.

Last edited by phrontister (2015-04-27 18:36:02)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#33 2015-04-27 18:39:13

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

That is why I improved the NSolve command to only solve for Real numbers ( no imaginary).

You should see that only x = 59 and n = 6 are integers.

Since we know that there were only 4 possible solutions because there were only 4 pairs of divisors that when multiplied equal 615 we are almost done. Do you follow up to here?

There will be one more trick.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#34 2015-04-27 18:45:50

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

That improvement was a great improvement...for me!

You should see that only x = 59 and n = 6 are integers.

Yes, I'd spotted that from the original code.

Following you so far...


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#35 2015-04-27 18:54:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

What happens when you expand

Expand[(2^n-x) (2^n+x)]

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#36 2015-04-27 19:02:06

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Yes, I'd seen that when I recognised you'd used the 'difference between two squares' trick, as I mentioned above.

Sorry, but I have to vanish now for about an hour! sad

Thanks so far! smile


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#37 2015-04-27 19:03:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

Okay, as long as you see the answer is k = 2n for the power of 2. We are now done.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#38 2015-04-27 20:12:40

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Powers of Two and Squares

Hi, Bobby...back again.

Yes, I see that, thanks.

I sort-of understood most of the solution process from reading your first post, but felt hazy about it because I couldn't understand that code's output. All fixed now, though, because of your subsequent improved code.

Thanks for taking me through it! smile


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#39 2015-04-27 20:25:38

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of Two and Squares

I am glad you got it. This process of factoring and solving by pairing factors is common.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#40 2015-04-27 21:07:03

Bob
Administrator
Registered: 2010-06-20
Posts: 10,058

Re: Powers of Two and Squares

In this question there are very few possibilities.  I haven't come up with a fully analytic solution but I have reduced it to just 11 possibilities

As

we can conclude straight away that n  ≥  10  so k  ≥ 5

Further as all must be positive,  k ≤ 9.

So I used Excel.  Suppose a factor pair is factor1 x factor2 = 615 with factor1 > factor2 then

So I computed the pairs of values for x and looked to see if any came out the same.  Here is the one possibility:

wgWlmkW.gif

And that's it.  No more solutions.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

Board footer

Powered by FluxBB