Hello, wsc810!
I have a solution, but it might not be acceptable.
I made two continued fractions.
. .
. .
@wsc810 -- Your textbook should have a section that describes how to convert a general irrational number into a continued fraction. If so, just follow the instructions and apply them to your number. I'll give the steps needed to derive the first two partial quotients. You should be able to take it from there.
Let . Then the first partial quotient, , equals the integer part of , or, using the floor function,
which can easily be found with a calculator to equal 1. Thus, .
We now define and . Therefore, since
and so
Thus,
which is again a simple calculation.
So your continued fraction begins
You should be able to find the remaining partial quotients by recursively defining
Q_0=Q
a_0=[(P a)/Q]
P_0=P
it's the starting value and a=Int(sqrt(d))
[ *] represents Int(*)
a0=1
P0=65
Q0=37
37*a0 - 65=-28 a0=1
-20*a1-(-28)=8 a1=1
1*a2 -28=6 a2=14
why a2 is not right
the actual vaule is 1 . Mathematica work out expression [1,1,1,2;1,2,1,1,1,12,1,1]
A piece of advise: if you're going to write a lot or some rather involved mathematical
expressions, you better take a peek at the forum's section "Math Resources", subsection
"LaTeX help", and then re-write your stuff using LaTex, otherwise it comes out
too messy and it might be that not many people will even take a look at it.
For example, the following part of you message:
P_{ n + 1}=
Q_n*a_n - P_n
Q_{n + 1}=
(d-P_{n + 1}^2)/Q_n
would come out, using LaTeX, as:
,and this is way clearer
and thus much easier to read.
Tonio