Home > other >  Python is a small white for help
Python is a small white for help

Time:10-31


This is a blog to see, please analysis process inside a, b<84 how did it come to?

CodePudding user response:

Known (b - a) (b + a)=168
And a, b are integers, b - for integer
Because of (a + b) x (b - a)=168, so a + b is sure no more than 168
If a + b exceeds 168=168, the above equation that b - can only be a decimal, but b - a is an integer

CodePudding user response:

The
reference 1/f, 5250 response:
known (b - a) (b + a)=168
And a, b are integers, b - for integer
Because of (a + b) x (b - a)=168, so a + b is sure no more than 168
If a + b exceeds 168=168, the above equation that b - can only be a decimal, but b - a is an integer

My question is in the process of analysis, step 7 a, b<"" 84 "what is out of step 5" (b - a) (b + a)=168 "work out?

CodePudding user response:

refer to the second floor is xiang xiang I reply:
Quote: reference 1/f, 5250 response:
known (b - a) + a (b)=168
And a, b are integers, b - for integer
Because of (a + b) x (b - a)=168, so a + b is sure no more than 168
If a + b exceeds 168=168, the above equation that b - can only be a decimal, but b - a is an integer

My question is in the process of analysis, step 7 a, b<"" 84 "what is out of step 5" (b - a) (b + a)=168 "work out?

From his reasoning should be such a b at the same time as the odd number or at the same time for even the minimum value is 2 a - b + b maximum is 84 ab are <84

CodePudding user response:

Mathematical proof topic ah, ha ha
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Known: a, b for nonnegative integers, and b & gt; A, (b - a) (b + a)=168
Proof: b & lt;=84, a. & lt; 84
Proof: before issuing a & lt; 84:
Because of b & gt; A, the b - a positive integer, so a + b & lt; A=b +/168 (b - a) & lt;=168,
The 2 a & lt; 168, i.e. for a & lt; 84

Then the b & lt;=84:
Because b ^ 2 - a ^ 2=168, namely b ^ 2=168 + a ^ 2
Has proved a & lt; 84,
So 168 + 0 & lt;=b ^ 2 & lt; 168 + 84 ^ 2,
Known b & gt;=0, so SQRT (168) & lt;=b & lt; SQRT (168 + 84 ^ 2),
The 12.961 & lt;=b & lt; 84.994
B as an integer, so 12 & lt; B & lt;=84
Never put off till tomorrow what you can,
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Its code can be simplified a bit, do not need to know b & lt;=84, you just need to know a & lt; 84 it is ok to:
 import math 
For a in range (84) :
T=168 + a * a
P=int (math. SQRT (t))
If p * p==t:
Print (a * a - 100)
  • Related