hp40g+.book Page 11 Friday, December 9, 2005 1:03 AM

Typing:

DEF(U(N) = 2N+1)

produces the result:

U(N) = 2N+1

Typing:

U(3)

then returns:

7

Example

Calculate the first six Fermat numbers F1...F6 and determine whether they are prime.

So, you want to calculate:

F(k) = 22k + 1 for k = 1...6

Typing the formula:

222 + 1

gives a result of 17. You can then invoke the ISPRIME?() command, which is found in the MATH key’s Integer menu. The response is 1, which means TRUE. Using the history (which you access by pressing the

SYMB key), you put the expression 222 + 1 into the Equation Writer with ECHO, and change it to:

223 + 1

Or better, define a function F(K) by selecting DEF from the ALGB menu on the menu bar and type:

DEF(F(K) = 22k + 1)

The response is 22k + 1 and F is now listed amongst the variables (which you can verify using the VARS key).

For K=5, you then type:

F(5)

Computer Algebra System (CAS)

14-11