Skip to content

Commit

Permalink
simplify A000227
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Ferris committed Jul 11, 2024
1 parent 6abc9c5 commit 69e22f0
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions src/oeis/A000227.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
// Nearest integer to e^n.
export default function* A000227(): Generator<bigint> {
for (const n of [
1n,
3n,
7n,
20n,
55n,
148n,
403n,
1097n,
2981n,
8103n,
22026n,
59874n,
162755n,
442413n,
1202604n,
3269017n,
8886111n,
24154953n,
65659969n,
178482301n,
485165195n,
1318815734n,
3584912846n,
9744803446n,
26489122130n,
72004899337n,
195729609429n,
532048240602n,
1446257064291n,
3931334297144n,
10686474581524n,
]) {
yield n
for (let n = 0n; /*∞*/; n++) {
yield BigInt(Math.round(Math.exp(Number(n))))
}
// for (const n of [
// 1n,
// 3n,
// 7n,
// 20n,
// 55n,
// 148n,
// 403n,
// 1097n,
// 2981n,
// 8103n,
// 22026n,
// 59874n,
// 162755n,
// 442413n,
// 1202604n,
// 3269017n,
// 8886111n,
// 24154953n,
// 65659969n,
// 178482301n,
// 485165195n,
// 1318815734n,
// 3584912846n,
// 9744803446n,
// 26489122130n,
// 72004899337n,
// 195729609429n,
// 532048240602n,
// 1446257064291n,
// 3931334297144n,
// 10686474581524n,
// ]) {
// yield n
// }
}

0 comments on commit 69e22f0

Please sign in to comment.