SOLUTION: Find all positive integers $n$ for which $n^2 - 19n + 99$ is a perfect square.

Algebra ->  Exponential-and-logarithmic-functions -> SOLUTION: Find all positive integers $n$ for which $n^2 - 19n + 99$ is a perfect square.      Log On


   



Question 1074625: Find all positive integers $n$ for which $n^2 - 19n + 99$ is a perfect square.
Answer by KMST(5328) About Me  (Show Source):
You can put this solution on YOUR website!
TIP:
When I see $ wrapping equations,
it remind me of LATEX,
and makes me suspect you come from artofproblemsolving.
We use triple curly brackets, like {, here.
I am going to look at the embarrassingly simpler solution in that website
as soon as I finish typing my awkward solution here.

ONE WAY:
We want n%5E2-19n%2B99=K%5E2 to be true
for some positive integers n and k .
n%5E2-19n%2B99=K%5E2
n%5E2-19n-K%5E2=-99
n%5E2-19n%2B19%5E2%2F4-K%5E2=19%5E2%2F4-99
%28n-19%2F2%29%5E2-K%5E2=19%5E2%2F4-99
4%28n-19%2F2%29%5E2-4K%5E2=19%5E2-4%2A99
%282n-19%29%5E2-%282K%29%5E2=361-396
%282n-19%29%5E2-%282K%29%5E2=-35
%282K%29%5E2-%282n-19%29%5E2=35
Let me abbreviate with the change of variables
system%28a=2K%2Cb=2n-19%29 ,
knowing that a=2K%3E0 is a positive, even integer,
and b is an integer.
The equation becomes
a%5E2-b%5E2=35 , so much easier to write,
and immediately we think of
%28a%2Bb%29%28a-b%29=35 .
Are those factors in brackets positive or negative?
We knew that a%5E2-b%5E2=35%3E0 ,
so a%5E2%3Eb%5E2 --> sqrt%28a%5E2%29%3Esqrt%28b%5E2%29 --> a%3Eabs%28b%29 ,
so whether b%3E0 or b%3C0 ,
%28a%2Bb%29%3E0 and %28a%2Bb%29%3E0 .
Back to the product of positive integer factors
%28a%2Bb%29%28a-b%29=35 .
The factors could be 1 and 35 or 5 and 7.
We have 4 possibilities:
system%28a%2Bb=1%2Ca-b=35%29-->system%28a=18%2Cb=-17%29-->2n-19=-17-->highlight%28n=1%29
system%28a%2Bb=35%2Ca-b=1%29-->system%28a=18%2Cb=17%29-->2n-19=17-->highlight%28n=18%29
system%28a%2Bb=5%2Ca-b=7%29-->system%28a=6%2Cb=-2%29-->2n-19=-1-->highlight%28n=9%29
system%28a%2Bb=7%2Ca-b=5%29-->system%28a=6%2Cb=1%29-->2n-19=1-->highlight%28n=10%29

ANOTHER WAY:
y=x%5E2-19x%2B99<-->y=%28x-9.5%29%5E2%2B8.75 , so if y=K%5E2 ,
K%5E2=%28x-9.5%29%5E2%2B8.75-->K%5E2-%28x-9.5%29%5E2=8.75-->%282K%29%5E2-%282x-19%29%5E2=4%2A8.75=35 .
The two perfect squares we look for, %282K%29%5E2 and %282x-19%29%5E2 ,
cannot be too large if their difference is only 35 .
There are not many possible solutions,
and they will all be close to the x=9.5 of the vertex.
So, listing values for y=n%5E2-19n%2B99 around n=9.5 ,
(or listing values for %282n-19%29%5E2%2B35 for 2n around n=9.5 ),
until you find a perfect square is an option.

PS: Actually, it was not that the artofproblemsolving solution was so much simpler,
but that they skip steps/explanations that "should be obvious,"
so they do not need to write as much.
If you get all those steps, artofproblemsolving is a fun site,
but I tend to/like to overexplain, so I belong at this website.