Post Reply 
(DM 42) Bernoulli and tangent numbers
03-22-2023, 08:46 AM
Post: #2
RE: (DM 42) Bernoulli and tangent numbers
The same, but using a matrix to store the numbers, so you can easily go beyond 999 ;-)
Also, I prefer not to use flags.
input 30 XEQ "B2n" runs in 0.57 seconds on batteries.

Code:
00 { 121-Byte Prgm }
01▸LBL "Tn"
02▸LBL 10
03 1
04 NEWMAT
05 EDIT
06 LASTX
07▸LBL 02 @ Tk    k
08 STOEL
09 ISG ST Y
10 X<>Y
11 RCL× ST Y
12 I+
13 FC? 76
14 GTO 02
15 2
16▸LBL 03
17 0
18 RCLEL
19 I+
20 FS? 76
21 GTO 00
22▸LBL 04 @ Tj-1 j-k k
23 X<>Y
24 STO× ST Y
25 2
26 +
27 X<>Y
28 RCLEL
29 RCL× ST Z
30 +
31 STOEL
32 DSE ST Y
33 I+
34 FC? 76
35 GTO 04
36 R^
37 1
38 STOIJ
39 +
40 GTO 03
41▸LBL "B2n"
42 XEQ 10
43 EDIT
44 CLX
45▸LBL 05
46 +/-
47 ENTER
48 SIGN
49 STO+ ST X
50 +
51 RCLEL
52 2
53 RCL ST Z
54 ABS
55 Y^X
56 X^2
57 LASTX
58 -
59 ÷
60 ×
61 STOEL
62 R↓
63 I+
64 FC? 76
65 GTO 05
66▸LBL 00
67 RCLEL
68 EXITALL
69 END

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (DM 42) Bernoulli and tangent numbers - Werner - 03-22-2023 08:46 AM



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