The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(33s) OEIS A000966: Prohibited Zero Endings of Factorials
09-30-2017, 10:02 AM (This post was last modified: 07-23-2022 10:12 AM by Gerald H.)
Post: #1
(33s) OEIS A000966: Prohibited Zero Endings of Factorials
[Edit 2022-07-23: Old line 5 of LBL A deleted as redundant.]

The following five programmes together produce 4 sequences from the OEIS on the HP 33s.

The 33s is a very fast calculator. The table below shows times on various HP calculators to calculate

A966(88,888,888,888)

using the programmes here presented & variously optimised for the respective calculator.

Model Time in sec
42S 45
40G 40
38G 30
35s 18
39gs 14
50g User 8.8
33s 8
49G Sys 1.2
50g Sys 0.6

The first programme takes a real integer N from the stack & returns A966(N) to stack.

https://oeis.org/A000966

Code:
1.    LBL A
2.    STO A
3.    XEQ B
4.    ENTER
5.    STO B
6.    XEQ D
7.    STO D
8.    RCL B
9.    ENTER
10.    ENTER
11.    6
12.    *
13.    -1
14.    STO Z
15.    +
16.    STO E
17.    x<>y
1.    LBL Q
2.    XEQ V
3.    STO+ E
4.    x≠0?
5.    GTO Q
6.    RCL D
7.    x≠0?
8.    GTO R
9.    RCL E
10.    RTN
1.    LBL R
2.    1
3.    STO+ Z
4.    STO- A
5.    RCL A
6.    XEQ B
7.    RCL B
8.    x=y?
9.    GTO R
10.    RCL E
11.    RCL- D
12.    RCL+ Z
13.    RTN

Takes a real integer N from the stack & returns A228297(N) to stack.

https://oeis.org/A228297

Code:
1.    LBL B
2.    ENTER
3.    ENTER
4.    XEQ V
5.    -
1.    LBL O
2.    ENTER
3.    ENTER
4.    XEQ C
5.    +
6.    x<>y
7.    R↓
8.    x<>y
9.    -
10.    x≥0?
11.    GTO P
12.    SGN
13.    R↑
14.    x<>y
15.    -
16.    GTO O
17.    LBL P
18.    R↑
19.    RTN

Takes a real integer N from the stack & returns A27868(N) to stack, leaving Y, Z & T stack levels unaltered.

https://oeis.org/A027868

Code:
1.    LBL C
2.    x<>L
3.    CLx
4.    x<>L
1.    LBL N
2.    XEQ V
3.    STO+ L
4.    x≠0?
5.    GTO N
6.    x<>L
7.    RTN

Takes a real integer N from the stack & returns A112765(N) to stack.

https://oeis.org/A112765

Code:
1.    LBL D
2.    -1
1.    LBL L
2.    1
3.    +
4.    x<>y
5.    XEQ V
6.    x<>y
7.    RCL R
8.    x≠0?
9.    GTO M
10.    R↓
11.    GTO L
1.    LBL M
2.    R↓
3.    RTN

Takes a real integer from the stack & stores remainder on division by 5 in R & quotient in Q & returns Q to stack, leaving Y, Z & T stack levels unaltered.

Code:
1.    LBL V
2.    R↑
3.    STO J
4.    R↓
5.    STO R
6.    5
7.    RMDR
8.    x<>R
9.    5
10.    INT/
11.    R↑
12.    X<>J
13.    R↓
14.    STO Q
15.    RTN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(33s) OEIS A000966: Prohibited Zero Endings of Factorials - Gerald H - 09-30-2017 10:02 AM



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