The Museum of HP Calculators


Riemann Zeta Function for the HP-41

This program is Copyright © 2006 by Jean-Marc Baillard and is used here by permission.

This program is supplied without representation or warranty of any kind. Jean-Marc Baillard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.


Overview
 

-The Riemann Zeta function is defined by the series:       Zeta(x) = 1 + 1/2x + 1/3x + ........ + 1/nx + ......     ( x > 1)
  but the following program uses the formula:                 ( 1 - 1/2x + 1/3x - 1/4x + ...... ) / ( 1 - 21-x )   which converges more rapidly
 

Program Listing
 

Data Registers:  R00 & R01 ( temp )
Flags: /
Subroutines: /
 

01  LBL "ZETA"
02  CHS
03  STO 01
04  1
05  STO 00
06  ENTER^
07  LBL 01
08  CLX
09  SIGN
10  RCL 00
11  +
12  STO 00
13  RCL 01
14  Y^X
15  -
16  CHS
17  LASTX
18  RND                   the accuracy is determined by the display format.
19  X#0?
20  GTO 01
21  SIGN
22  2
23  RCL 01
24  Y^X
25  ST+ X
26  -
27  /
28  ABS
29  END

( 40 bytes / SIZE 002 )
 

Example:    Calculate Apery's number = Zeta(3)

FIX 7     3      XEQ "ZETA"    gives    1.2020569          ( in 3m14s )
FIX 9     3             R/S            -----    1.202056903      ( in 15m12s )

-Execution time and Zeta(x) tend to infinity as x tends to 1.
 

Reference:          Abramowitz and Stegun , "Handbook of Mathematical Functions" -  Dover Publications -  ISBN  0-486-61272-4
 

Go back to the HP-41 software library
Go back to the general software library
Go back to the main exhibit hall