MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / checkSequence

Function checkSequence

src/compute-engine/oeis.ts:299–320  ·  view source on GitHub ↗
(
  ce: ComputeEngine,
  name: string,
  count: number = 10,
  options: OEISOptions = {}
)

Source from the content-addressed store, hash-verified

297 return lookupOEISByTerms(numericTerms, options);
298}
299
300/**
301 * Check if a defined sequence matches an OEIS sequence.
302 *
303 * @param ce - ComputeEngine instance
304 * @param name - Name of the defined sequence
305 * @param count - Number of terms to check (default: 10)
306 * @param options - Optional configuration
307 * @returns Promise with match results
308 */
309export async function checkSequence(
310 ce: ComputeEngine,
311 name: string,
312 count: number = 10,
313 options: OEISOptions = {}
314): Promise<{
315 matches: OEISSequenceInfo[];
316 terms: number[];
317}> {
318 if (!ce.isSequence(name)) {
319 throw new Error(`'${name}' is not a defined sequence`);
320 }
321 // The terms start at the first index of the domain of the sequence
322 // (0 when the domain has no lower bound).
323 const info = ce.getSequence(name);

Callers

nothing calls this directly

Calls 3

lookupOEISByTermsFunction · 0.85
getSequenceTermsMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected