AngouriMath

Navigation

← Back to list of members

Factorize​(AngouriMath.​Entity.​Number.​Integer)

 Method (no overloads)

Summary

Factorization of integer. Returns a sequence of unique primes
and their corresponding power. Sorted by value of prime (starting
from the smallest).

Example

var factors = MathS.NumberTheory.Factorize(1872);
foreach (var (prime, power) in factors)
    Console.WriteLine($"{prime} ^ {power}");

Prints
2 ^ 4
3 ^ 2
13 ^ 1

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online