1.0.0 • Published 2 years ago

collatzy v1.0.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

collatzy

A simple collatz conjecture calculator for Javascript.

How to use

Install with npm: npm i collatzgen

Import:

// Import every function
import { collatz, next } from "collatzy"

// Calculate collatz conjecture of 13
// This returns an array containing every number in order.
console.log(collatz(13).toString()) // Returns 40,20,10,5,16,8,4,2,1

// Get the next collatz calculation in line.
console.log(next(5)) // Returns 16
1.0.0

2 years ago