2.0.14 • Published 3 years ago
@algorithm.ts/sieve-totient v2.0.14
A typescript implementation of the Linear Sieve algorithm for primes numbers and Euler's totient function.
If you are curious about this algorithm, you can visit here for more details.
Install
npm
npm install --save @algorithm.ts/sieve-totientyarn
yarn add @algorithm.ts/sieve-totientdeno
import sieveTotient from 'https://raw.githubusercontent.com/guanghechen/algorithm.ts/main/packages/sieve-totient/src/index.ts'
Usage
Get all prime numbers and totient function values in the range $[2, N)$:
import sieveTotient from '@algorithm.ts/sieve-totient' const [totients, primes] = sieveTotient(10) // => // totients: [0, 1, 1, 2, 2, 4, 2, 6, 4, 6] // primes: [2, 3, 5, 7]
Related
2.0.14
3 years ago
2.0.13
3 years ago
2.0.12
4 years ago
2.0.8-alpha.0
4 years ago
2.0.7-alpha.1
4 years ago
2.0.7-alpha.0
4 years ago
2.0.5
4 years ago
2.0.4
4 years ago
2.0.11
4 years ago
2.0.7
4 years ago
2.0.6
4 years ago
2.0.9
4 years ago
2.0.10
4 years ago
2.0.8
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.0-alpha.0
4 years ago
2.0.1
4 years ago
1.0.24
4 years ago
2.0.0
4 years ago
1.0.23
4 years ago
1.0.22
4 years ago
1.0.21
4 years ago