Skip to content

feat: add tribonacci using matrix exponentiation#3150

Open
Hxrshthetic wants to merge 3 commits into
TheAlgorithms:masterfrom
Hxrshthetic:tribonacci
Open

feat: add tribonacci using matrix exponentiation#3150
Hxrshthetic wants to merge 3 commits into
TheAlgorithms:masterfrom
Hxrshthetic:tribonacci

Conversation

@Hxrshthetic
Copy link
Copy Markdown

Description of Change

This PR adds an implementation of the Tribonacci sequence using matrix exponentiation.

The implementation computes the nth Tribonacci number efficiently in O(log n) time using a 3x3 transformation matrix and binary exponentiation.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Adds tribonacci implementation using matrix exponentiation with O(log n) complexity.

@Hxrshthetic
Copy link
Copy Markdown
Author

@Panquesito7 and @realstealthninja
Please review this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant