The greatest common divisor ( GCD ) of two integers a and b is usually calculated with the ( wellknown ) Euclidean Algorithm. There is however an alternative algorithm which is based on an entirely different idea. Let's illustrate this idea with an example. Let a, b be integers, a >:b and (a, b) = GCD(a,b). Then the following rules can be applied recursively until a=b=GCD(a,b):
If ( a=even AND b=even) then GCD(a,b)=2*GCD(a/2,b/2)
If ( a=odd AND b=even) then GCD(a,b)=GCD(a,b/2)
If ( a=even AND b=odd) then GCD(a,b)=GCD(a/2,b)
If ( a=odd AND b=odd) then GCD(a,b)=GCD(ab,b)
Example
(36, 27) = (27, 36/2)
(27, 18) = (27, 18/2)
(27, 9) = (279, 9)
(18, 9) = (18/2, 9)
(9, 9) Halt.
GCD(36,27)=9.
Compare using the Euclidean Algorithm
36 = 1 * 27 + 9
27 = 3 * 9 + 0 Halt.
GCD(36,27)=9.
However, this doesn't mean that the Euclidean Algorithm is always faster.
Tuesday, March 25, 2008
Monday, March 17, 2008
Calculating squares
Try ( without a calculator )
21^2 ?
37^2 ?
If you need a calculator to calculate simple squares then you may need the following simple rule.
21^2 = 441
37^2 = 1369.
Or using ( x  k ) * ( x + k ) + k^2 = x^2
21^2 = 20 * 22 + 1^2 = 440 + 1 = 441
37^2 = 34 * 40 + 3^2 = 1200 + 160 + 9 = 1369.
21^2 ?
37^2 ?
If you need a calculator to calculate simple squares then you may need the following simple rule.
21^2 = 441
37^2 = 1369.
Or using ( x  k ) * ( x + k ) + k^2 = x^2
21^2 = 20 * 22 + 1^2 = 440 + 1 = 441
37^2 = 34 * 40 + 3^2 = 1200 + 160 + 9 = 1369.
Cubic numbers
Create a triangle from the sequence of odd numbers s[n]=2n1 by writing s[1] on the first row, s[2] and s[3] on the second row, the next three numbers from the sequence on the third row, ... the next k numbers on the kth row. For example:
The vertical column contains the sums by row of the numbers in the triangle. It is easy to see that this column contains the cubic numbers.
The vertical column contains the sums by row of the numbers in the triangle. It is easy to see that this column contains the cubic numbers.
Sunday, March 16, 2008
Primes
Mathematicians have tried in vain to this day to discover some order in the sequence of prime numbers, and we have reason to believe that it is a mystery into which the mind will never penetrate. (Leonard Euler)
Monday, March 10, 2008
Roman numerals
Just noticed that the BBC uses Roman numerals for copyright dating. (c) MMVIII.
I  1
V  5
X  10
L  50
C  100
D  500
M  1000
1 I
2 II
3 III
4 IV
5 V
6 VI
7 VII
8 VIII
9 IX
10 X
11 XI
12 XII
13 XIII
14 XIV
15 XV
16 XVI
17 XVII
18 XVIII
19 XIX
20 XX
I  1
V  5
X  10
L  50
C  100
D  500
M  1000
1 I
2 II
3 III
4 IV
5 V
6 VI
7 VII
8 VIII
9 IX
10 X
11 XI
12 XII
13 XIII
14 XIV
15 XV
16 XVI
17 XVII
18 XVIII
19 XIX
20 XX
Sunday, March 2, 2008
My goal
I decided that I should have a goal related to my math hobby. I don't know if that is good or bad. It is my goal to get this degree in mathematics. It has been in the back of my mind for a while. It's time to come out of the closet. Having a secret goal is a sort of fear of failure I guess. Working towards a goal is more fun than having achieved a goal because once a goal has been achieved new goals turn up. Talking ( writing ) about what I am doing is the purpose of this blog anyway. ( To be continued. )
Subscribe to:
Posts (Atom)
Popular Posts

Among lectures on Calculus I,II and III, ( Introduction to ) Linear Algebra and ( Introduction to ) Differential Equations from the UCCS ( ...

Problem: We want to calculate the sum of the elements of a list of numbers. Suppose this list is named l and has been assigned the value {1,...

Today I started to read the Ramanujan biography ( The ebook version, of course. ) The book looks promising. What was it like to communicate...

I found a set of video lectures on Abstract Algebra. MATH E222 Abstract Algebra  http://www.extension.harvard.edu/openlearning/math222/ E...

Ramanujan's genius (r) was discovered by Hardy (l) At a very young age Ramanujan designed the following formula for a 3 by 3 magic sq...
Welcome to The Bridge
Mathematics: is it the fabric of MEST?
This is my voyage
My continuous mission
To uncover hidden structures
To create new theorems and proofs
To boldly go where no man has gone before
(Raumpatrouille – Die phantastischen Abenteuer des Raumschiffes Orion, colloquially aka Raumpatrouille Orion was the first German science fiction television series. Its seven episodes were broadcast by ARD beginning September 17, 1966. The series has since acquired cult status in Germany. Broadcast six years before Star Trek first aired in West Germany (in 1972), it became a huge success.)