UNPKG

@algorithm.ts/sieve-totient

Version:

A linear time algorithm to sieve prime numbers and get the Euler's totient function

10 lines (8 loc) 274 B
/** * * @param N * @returns * @see https://me.guanghechen.com/post/math/number-theory/sieve/#heading-%E7%BA%BF%E6%80%A7%E7%AD%9B-2 */ declare function sieveTotient(N: number): [totient: Uint32Array, primes: number[]]; export { sieveTotient as default, sieveTotient };