add ability to sieve custom function
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
<hgroup>
|
||||
<h1>Sieving Multiplicative Functions</h1>
|
||||
<p>Posted <time datetime="2026-04-15">April 15, 2026</time></p>
|
||||
<p>Updated <time datetime="2026-05-04">May 4, 2026</time></p>
|
||||
</hgroup>
|
||||
|
||||
<p>The
|
||||
@@ -76,8 +77,15 @@
|
||||
<option value="mobius">Mobius</option>
|
||||
<option value="big-omega">Prime omega (with multiplicity)</option>
|
||||
<option value="little-omega">Prime omega (without multiplicity)</option>
|
||||
<option value="custom">Custom</option>
|
||||
</select>
|
||||
|
||||
<label hidden id="custom-function-label" for="custom-function">Custom function definition</label>
|
||||
<textarea hidden spellcheck=false placeholder="return Math.pow(p, k-1) * (p-1);" id="custom-function"></textarea>
|
||||
|
||||
<label hidden id="custom-function-additive-label" for="custom-function-additive">Function is additive</label>
|
||||
<input hidden type="checkbox" id="custom-function-additive" />
|
||||
|
||||
<input type="button" id="enter" value="Enter" />
|
||||
</div>
|
||||
|
||||
@@ -1125,7 +1133,8 @@ function mobius(p, k) {
|
||||
|
||||
<p>Many multiplicative and additive functions have simple formulas
|
||||
for prime powers, which makes adding a new function to sieve very
|
||||
easy with this approach.</p>
|
||||
easy with this approach. The demo even lets you write your own custom
|
||||
function to sieve - try it out!</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
Reference in New Issue
Block a user