Skip to content

Commit

Permalink
implement A000245
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Ferris committed Jul 11, 2024
1 parent db86b2f commit 4886e0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/oeis/A000108.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ import { factorial } from '../utils'
export default function* A000108(): Generator<bigint> {
for (let n = 0n; /*∞*/; n++) {
yield factorial(2n * n) / factorial(n + 1n) / factorial(n)

}
}
37 changes: 6 additions & 31 deletions src/oeis/A000245.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
import { factorial } from '../utils'

// a(n) = 3*(2*n)!/((n+2)!*(n-1)!).
export default function* A000245(): Generator<bigint> {
for (const n of [
0n,
1n,
3n,
9n,
28n,
90n,
297n,
1001n,
3432n,
11934n,
41990n,
149226n,
534888n,
1931540n,
7020405n,
25662825n,
94287120n,
347993910n,
1289624490n,
4796857230n,
17902146600n,
67016296620n,
251577050010n,
946844533674n,
3572042254128n,
13505406670700n,
51166197843852n,
194214400834356n,
]) {
yield n
yield 0n
for (let n = 1n; /*∞*/; n++) {
// 3*(2*n)!/((n+2)!*(n-1)!)
yield 3n * factorial(2n * n) / ( factorial(n + 2n) * factorial(n - 1n) )
}
}

0 comments on commit 4886e0b

Please sign in to comment.