September 30, 2005
7:30 am

Courant & Robbins [p. 23]
I have generated 5 prime numbers using Euclid's method. Now to check that I haven't made any errors.

In[1]:=

Factor[7]

Out[1]=

7

In[2]:=

Factor[43]

Out[2]=

43

In[3]:=

Factor[1807]

Out[3]=

1807

In[4]:=

Factor[3263443]

Out[4]=

3263443

In[5]:=

Factor[10650056950807]

Out[5]=

10650056950807

In[6]:=

Factor[6]

Out[6]=

6

Ooops!! Factor isn't doing what I thought it was.

In[7]:=

Simplify[6]

Out[7]=

6

In[9]:=

FactorInteger[7]

Out[9]=

{{7, 1}}

There, that is the function I want. Now...

In[10]:=

FactorInteger[10650056950807]

Out[10]=

{{547, 1}, {607, 1}, {1033, 1}, {31051, 1}}

That hurts. There are some factors. I did make a mistake.

In[11]:=

FactorInteger[43]

Out[11]=

{{43, 1}}

Dummy. I was right all along. I didn't look closely at the output. All of the factors were prime numbers. Still, there is a lesson here as well.


Created by Mathematica  (September 30, 2005) Valid XHTML 1.1!