(11C) Bernoulli Numbers
07-28-2019, 06:05 AM (This post was last modified: 07-29-2019 06:04 AM by Gamo.)
Post: #1
 Gamo Senior Member Posts: 605 Joined: Dec 2016
(11C) Bernoulli Numbers
This program was adapted from [HP-12C Bernoulli Numbers] at

With 11C and 15C the result answer is more accurate because of the Pi function.

Procedure:

Same as on 12C except

Looking for B(n) execute at [LBL] B

Need answer in fraction execute at [LBL] D
-----------------------------------------------
Program:
For faster computation recommend HP-15C LE or Emulator
Code:
 LBL B   // B(n) for n  ÷ 2 2 x  STO 2 1 STO 0 STO 1  // Done Initialize  ----------- LBL 0 RCL 0 2 x 1 + RCL 2 CHS Y^X   RCL 1 + RCL 1 X=Y GTO 1 X<>Y STO 1 1 STO+0 GTO 0 ---------- LBL 1 RCL 2 x! 2 x RCL 1 x 2 RCL 2 Y^X 1 - RCL 2 Pi X<>Y Y^X x ÷ RTN  // If B(n) with n divisible by 4 answer is "Negative" ---------- LBL D  // For Decimal to Fraction  STO 0 STO 1 0 ENTER ENTER 1 R^  // Roll Up --------- LBL 5 INT R^   x + STO 2 GSB 7 X<>Y ÷ RND RCL 0 RND X=Y GTO 6 + CLx RCL 2 ENTER ENTER R^ RCL 1 FRAC 1/x STO 1 GTO 5 --------- LBL 6 RCL 2 --------- LBL 7 ENTER ENTER RCL 0 x . 5  // decimal and five + INT RTN

Gamo
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)