{"record":{"id":"dc28e17349cb0f74","repo":"jackwener/OpenCLI","slug":"oeis-sequence","errorCode":"oeis sequence","errorMessage":"OEIS sequence \"${id}\" not found.","messagePattern":"OEIS sequence \"(.+?)\" not found\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/oeis/sequence.js","lineNumber":48,"sourceCode":"        'termCount',\n        'offset',\n        'author',\n        'created',\n        'revision',\n        'commentCount',\n        'formulaCount',\n        'referenceCount',\n        'xrefCount',\n        'linkCount',\n        'url',\n    ],\n    func: async (args) => {\n        const id = requireSequenceId(args.id);\n        const url = `${OEIS_BASE}/search?q=id:${encodeURIComponent(id)}&fmt=json`;\n        const body = await oeisFetch(url, 'oeis sequence');\n        const list = Array.isArray(body) ? body : [];\n        if (!list.length) {\n            throw new EmptyResultError('oeis sequence', `OEIS sequence \"${id}\" not found.`);\n        }\n        const r = list[0];\n        const data = typeof r?.data === 'string' ? r.data : '';\n        const termCount = data ? data.split(',').filter(Boolean).length : 0;\n        return [{\n            id: formatId(r?.number) ?? id,\n            name: typeof r?.name === 'string' ? r.name : null,\n            keywords: typeof r?.keyword === 'string' ? r.keyword : null,\n            preview: previewTerms(data),\n            termCount,\n            offset: typeof r?.offset === 'string' ? r.offset : null,\n            author: typeof r?.author === 'string' ? r.author : null,\n            created: typeof r?.created === 'string' ? r.created : null,\n            revision: typeof r?.revision === 'number' ? r.revision : null,\n            commentCount: asArray(r?.comment).length,\n            formulaCount: asArray(r?.formula).length,\n            referenceCount: asArray(r?.reference).length,\n            xrefCount: asArray(r?.xref).length,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/oeis/sequence.js#L30-L66","documentation":"An EmptyResultError with code \"oeis sequence\" thrown when the id-based OEIS lookup (search?q=id:A<n>&fmt=json) returns an empty array, meaning OEIS has no sequence with that A-number. The id passed requireSequenceId validation, so it is well-formed but unknown.","triggerScenarios":"Requesting a well-formed but non-existent A-number (e.g. A9999999), a mistyped digit in a valid id, or referencing an id from a stale cache/link pointing at a renumbered/removed entry.","commonSituations":"Typos when transcribing A-numbers from papers or logs, assuming ids are contiguous, or using fabricated ids in generated test data.","solutions":["Verify the A-number on oeis.org directly (oeis.org/A000045).","Use oeis search with the sequence terms instead of the id to recover the correct id.","Check for digit transposition in the id you typed.","Confirm the entry still exists — OEIS occasionally renumbers or merges sequences."],"exampleFix":"// before\noeis sequence A0000046\n// after (Fibonacci)\noeis sequence A000045","handlingStrategy":"fallback","validationCode":"const SEQ_ID = /^A\\d{1,7}$/;\nif (!SEQ_ID.test(String(raw ?? '').trim())) throw new Error('bad A-number');","typeGuard":"const isSeqId = (v) => /^A\\d{1,7}$/.test(String(v ?? '').trim());","tryCatchPattern":"try { return await oeisSequence(id); } catch (e) { if (e.code === 'oeis sequence') return null; throw e; }","preventionTips":["Verify A-numbers on oeis.org before scripted use.","Fall back to a term-based search when an id lookup comes up empty.","Watch for digit transposition when transcribing ids.","Don't assume OEIS ids are contiguous or permanent."],"tags":["empty-result","not-found","oeis","lookup"],"backgroundTag":"record-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}