Function
Static Public Summary | ||
public |
atos(i: *, n: *): * Converts a square Ulam spiral index to an array index. |
|
public |
itop(i: *): * |
|
public |
itop2(i: *): * |
|
public |
itop23(i: *): * |
|
public |
itop230(i: *): * |
|
public |
itop231(i: *): * |
|
public |
ptoi(p: *): * |
|
public |
ptoi2(p: *): * |
|
public |
ptoi23(p: *): * |
|
public |
ptoi230(p: *): * |
|
public |
ptoi231(p: *): * |
|
public |
stoa(i: *, n: *): * Converts an array index to a square Ulam spiral index. |
Static Private Summary | ||
private |
__eratosthenes23__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * Sieve of Eratosthenes skipping all multiples of 2 and 3. |
|
private |
__eratosthenes2__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * Sieve of Eratosthenes skipping all multiples of 2. |
|
private |
__eratosthenes__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * Sieve of Eratosthenes. |
|
private |
__gothrough__(set: setter): * Goes through an array and crosses out non prime numbers. |
Static Public
public atos(i: *, n: *): * source
import {atos} from '@number-theoretic/primes/src/ulam/atos.js'
Converts a square Ulam spiral index to an array index.
Params:
Name | Type | Attribute | Description |
i | * | ||
n | * |
Return:
* |
public itop(i: *): * source
import {itop} from '@number-theoretic/primes/src/sieve/itop.js'
Params:
Name | Type | Attribute | Description |
i | * |
Return:
* |
public itop2(i: *): * source
import {itop2} from '@number-theoretic/primes/src/sieve/itop2.js'
Params:
Name | Type | Attribute | Description |
i | * |
Return:
* |
public itop23(i: *): * source
import {itop23} from '@number-theoretic/primes/src/sieve/itop23.js'
Params:
Name | Type | Attribute | Description |
i | * |
Return:
* |
public itop230(i: *): * source
import {itop230} from '@number-theoretic/primes/src/sieve/itop230.js'
Params:
Name | Type | Attribute | Description |
i | * |
Return:
* |
public itop231(i: *): * source
import {itop231} from '@number-theoretic/primes/src/sieve/itop231.js'
Params:
Name | Type | Attribute | Description |
i | * |
Return:
* |
public ptoi(p: *): * source
import {ptoi} from '@number-theoretic/primes/src/sieve/ptoi.js'
Params:
Name | Type | Attribute | Description |
p | * |
Return:
* |
public ptoi2(p: *): * source
import {ptoi2} from '@number-theoretic/primes/src/sieve/ptoi2.js'
Params:
Name | Type | Attribute | Description |
p | * |
Return:
* |
public ptoi23(p: *): * source
import {ptoi23} from '@number-theoretic/primes/src/sieve/ptoi23.js'
Params:
Name | Type | Attribute | Description |
p | * |
Return:
* |
public ptoi230(p: *): * source
import {ptoi230} from '@number-theoretic/primes/src/sieve/ptoi230.js'
Params:
Name | Type | Attribute | Description |
p | * |
Return:
* |
public ptoi231(p: *): * source
import {ptoi231} from '@number-theoretic/primes/src/sieve/ptoi231.js'
Params:
Name | Type | Attribute | Description |
p | * |
Return:
* |
public stoa(i: *, n: *): * source
import {stoa} from '@number-theoretic/primes/src/ulam/stoa.js'
Converts an array index to a square Ulam spiral index.
Params:
Name | Type | Attribute | Description |
i | * | ||
n | * |
Return:
* |
Static Private
private __eratosthenes23__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * source
import {__eratosthenes23__} from '@number-theoretic/primes/src/sieve/eratosthenes23.js'
Sieve of Eratosthenes skipping all multiples of 2 and 3.
5 7 11 13 17 19 23 25 29 31 35 37 41 43 47 49 53 55 59 61 65 67 71 73 77 79 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
83 85 89 91 95 97 101 103 107 109 113 115 119 121 125 127 131 133 137 139 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
143 145 149 151 155 157 161 163 167 169 173 175 179 181 185 187 191 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
i( 5) = 0 i(25) = 7 i(35) = 10 = 7 + 5 - 2
i( 7) = 1 i(49) = 15 i(77) = 24 = 15 + 7 + 2
i( 11) = 2 i(121) = 39 i(143) = 46 = 39 + 11 - 4
i( 13) = 3 i(139) = 45 i(191) = 62 = 45 + 13 + 4
Params:
Name | Type | Attribute | Description |
alloc | * | ||
fill | * | ||
get | * | ||
gothrough | * | ||
usqrt | * |
Return:
* |
private __eratosthenes2__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * source
import {__eratosthenes2__} from '@number-theoretic/primes/src/sieve/eratosthenes2.js'
Sieve of Eratosthenes skipping all multiples of 2.
Params:
Name | Type | Attribute | Description |
alloc | * | ||
fill | * | ||
get | * | ||
gothrough | * | ||
usqrt | * |
Return:
* |
private __eratosthenes__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * source
import {__eratosthenes__} from '@number-theoretic/primes/src/sieve/eratosthenes.js'
Sieve of Eratosthenes.
Params:
Name | Type | Attribute | Description |
alloc | * | ||
fill | * | ||
get | * | ||
gothrough | * | ||
usqrt | * |
Return:
* |
private __gothrough__(set: setter): * source
import {__gothrough__} from '@number-theoretic/primes/src/sieve/gothrough.js'
Goes through an array and crosses out non prime numbers.
Params:
Name | Type | Attribute | Description |
set | setter | function ( a , i , v ) that sets value v at index i in array a |
Return:
* |