Home Manual Reference Source

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

Converts a square Ulam spiral index to an array index.

Params:

NameTypeAttributeDescription
i *
n *

Return:

*

public itop(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public itop2(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public itop23(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public itop230(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public itop231(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public ptoi(p: *): * source

Params:

NameTypeAttributeDescription
p *

Return:

*

public ptoi2(p: *): * source

Params:

NameTypeAttributeDescription
p *

Return:

*

public ptoi23(p: *): * source

Params:

NameTypeAttributeDescription
p *

Return:

*

public ptoi230(p: *): * source

Params:

NameTypeAttributeDescription
p *

Return:

*

public ptoi231(p: *): * source

Params:

NameTypeAttributeDescription
p *

Return:

*

public stoa(i: *, n: *): * source

Converts an array index to a square Ulam spiral index.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
alloc *
fill *
get *
gothrough *
usqrt *

Return:

*

private __eratosthenes__(alloc: *, fill: *, get: *, gothrough: *, usqrt: *): * source

Sieve of Eratosthenes.

Params:

NameTypeAttributeDescription
alloc *
fill *
get *
gothrough *
usqrt *

Return:

*

private __gothrough__(set: setter): * source

Goes through an array and crosses out non prime numbers.

Params:

NameTypeAttributeDescription
set setter

function ( a , i , v ) that sets value v at index i in array a

Return:

*