tolik518 / tolik518/factorion-bot
Superfactorials
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 51
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Description
Superfactorials now have been requested multiple times. They are defined:
n$ = \prod_{i=1}^n i! = G(n+2)
A simple notation, that is common enough to warrant its own command. The G here is an analytical continuation, so unlike multitermials and subfactorials (both of which I cannot find one for) it can relatively easily support decimals. One consideration to take is efficiency, we will need to approximate way earlier.
There is a sterling-like approximation:
\ln G(1+z) ∼ z^2\left(\frac{1}{2}\ln z-\frac{3}{4}\right)+\frac{1}{2}\ln(2\pi)z-\frac{1}{12}\ln z+\zeta'(-1)+\sum_{k=1}^n\frac{B_{2k+2}}{4k(k+1)z^{2k}}+O\left(\frac{1}{z^{2n+2}}\right)
Where B_k is the k-th Bernulli number approximated by:
B_{2n} ∼ (-1)^{n-1}4\sqrt{\pi n}\left(\frac{n}{\pi e}\right)^{2n}
If that proves too complex (and inefficient) there is a simpler form:
\ln G(1+z) ∼ z^2\left(\frac{1}{2}\ln z-\frac{3}{4}\right)+\frac{1}{2}\ln(2\pi)z-\frac{1}{12}\ln z+\zeta'(-1)+O\left(\frac{1}{z}\right)
Reasoning
This has been requested here:
- https://www.reddit.com/r/unexpectedfactorial/comments/1lo5e38/comment/n0kar1q
- https://www.reddit.com/r/unexpectedfactorial/comments/1ln30oj/petition_to_add_superfactorial/ (whole post)
Resources
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reviewing the existing factorial command behavior and the Barnes G and superfactorial resources linked in the issue; define supported inputs, notation, approximation accuracy, and completion tests before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100