Implementations of select OEIS integer sequences in JavaScript, portially inspired by intseq.
yarn add jisgimport {A000045} from 'jisg'
const generator = A000045()
for (let i=0; i<43; i++) {
console.log(generator.next().value)
}const {A000045} = require('jisg')
for (const i of A000045()) {
console.log(i)
}<script src="https://unpkg.com/jisg"></script>
<script>
const generator = jisg.A000045()
setInterval(
function() => {
document.write(
generator.next().value,
', '
)
},
666
)
</script>yarn install: Install dependenciesyarn dev: Run tests when source files are changedyarn lint --fix: Lint with ESLintyarn test: Run testsyarn doc: Build documentationyarn build: Production buildyarn prepublish: Prepare for publishingyarn publish: Publish to npm
- Report bug and feature requests as GitHub Issues
- Fork and clone your repo locally.
- Create the source file in "src/oeis/" using the OEIS number (e.g. "A000001.ts") and add an entry in index.ts.
- Add sample sequence for testing, e.g. tests/samples/A000001.csv
- Implement the generator so that the test case passes (e.g.
yarn test -t A000001). Important: Sequences should be generated algorithmically whenever possible. Avoid hard-coding values. Strive for simple, concise code that demonstrates the algorithm and aims to generate infinite terms efficiently. If the test takes longer than 10 seconds, optimize or remove integers from the end of the sample until it takes less than 10 seconds. - Check code style and test coverage with
yarn prepublishand fix any issues. - Push to GitHub and submit a pull request.

