lms

package
v0.0.0-...-df22835 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factorial

func Factorial(input int) int

Factorial returns the factorial(!) of a number (5!=1x2x3x4x5=120) https://www.mathsisfun.com/numbers/factorial.html The formula = n! = n × (n−1)!

func FindFactors

func FindFactors(input int) []int

FindFactors finds the factors of a number. You should be able to do some voodoo with PrimeFactors, but I'm not using that yet.

func FindNumFactors

func FindNumFactors(input int, primes []int) int

FindNumFactors finds the number of factors of a number. You should be able to do some voodoo with PrimeFactors, but I'm not using that yet.

func GetTriangularNumber

func GetTriangularNumber(nth int) int

GetTriangularNumber finds the Nth triangular number. Formule Triangular numbers: https://www.mathsisfun.com/algebra/triangular-numbers.html. Rule: xn = n(n+1)/2

func PrimesBelow

func PrimesBelow(max int) (primes []int)

primesBelow is a primegenerator that finds primes below a number

Types

This section is empty.

Jump to

Keyboard shortcuts

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