Skip to main content
Module

x/collatz/src/utilities.ts>stoppingTimeTerminus

Functions related to the Collatz/Syracuse/3N+1 problem.
Latest
function stoppingTimeTerminus
import { stoppingTimeTerminus } from "https://deno.land/x/collatz@javascript-v1.2.0/src/utilities.ts";

Provides the appropriate lambda to use to check if iterations on an initial value have reached either the stopping time, or total stopping time.

Parameters

n: bigint
  • The initial value to confirm against a stopping time check.
totalStop: boolean
  • If false, the lambda will confirm that iterations of n have reached the oriented stopping time to reach a value closer to 0. If true, the lambda will simply check equality to 1.

Returns

(_: bigint) => boolean

the lambda (arrow function expression) to check for the stopping time.