triangles

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxTriangle is the largest triangular number we will consider
	MaxTriangle = 100000
)

Variables

View Source
var (
	// Triangles stores whether the position in the slice is triangular or not
	Triangles [MaxTriangle + 1]bool
)

Functions

func Init

func Init()

Init populates the Triangles cache

func Triangle

func Triangle(number int) bool

Triangle returns true if the number is triangular

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL