HP Forums

Full Version: (33s) OEIS A14261 & 14263: All Digits Even & All Digits Odd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Takes a natural number (in particular not zero) from the stack & returns A14261(N) & A14263(N) to stack.

https://oeis.org/A014261
https://oeis.org/A014263

Nth member of all digits odd
& Nth member of all digits even.
Preserves stack.

I can't see how to telescope the two loops into one - Anyone have an idea?

A14261 & A14263

Code:
1.    LBL A
2.    STO N
3.    SGN
4.    STO C
5.    +/-
6.    RCL+ N
7.    STO M
8.    CLx
9.    STO D
1.    LBL B
2.    CLx
3.    2*RMDR(N-1:5)+1
4.    RCL* C
5.    STO+ D
6.    CLx
7.    10
8.    STO* C
9.    CLx
10.    IDIV(N-1:5)
11.    STO N
12.    x>0?
13.    GTO B
14.    RCL+ D
15.    RCL C
16.    SGN
17.    STO C
18.    CLx
19.    STO D
1.    LBL C
2.    CLx
3.    RMDR(M:5)
4.    RCL* C
5.    STO+ D
6.    CLx
7.    10
8.    STO* C
9.    CLx
10.    IDIV(M:5)
11.    STO M
12.    x>0?
13.    GTO C
14.    RCL+ D
15.    RCL+ D
16.    RTN

A: LN = 27
B: LN = 95
C: LN = 78
Reference URL's