Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify exponential functions #229

Open
ckrause opened this issue Dec 29, 2022 · 1 comment
Open

Simplify exponential functions #229

ckrause opened this issue Dec 29, 2022 · 1 comment
Labels
enhancement Improvement that is not a feature

Comments

@ckrause
Copy link
Contributor

ckrause commented Dec 29, 2022

Check this formula:

; A139486: a(n) = Product_{j=0..n-1} (2^j + 2).
; Formula: a(n) = a(n-1)*(2*b(n-2)+2), a(1) = 3, a(0) = 1, b(n) = 2*b(n-1), b(1) = 2, b(0) = 1

=> b(n) should be simplified to 2^n
See https://github.com/loda-lang/loda-cpp/blob/main/src/formula.cpp#L231

@ckrause ckrause added the enhancement Improvement that is not a feature label Dec 29, 2022
@ckrause
Copy link
Contributor Author

ckrause commented Oct 15, 2023

Another example

; A085521: a(n) = Product_{k=0..n} (2^(2k+1)+1).
; Formula: a(n) = b(n)/3, b(n) = b(n-1)*(c(n-1)+1), b(1) = 9, b(0) = 3, c(n) = 4*c(n-1), c(1) = 8, c(0) = 2 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement that is not a feature
Projects
None yet
Development

No branches or pull requests

1 participant