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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Teorie čísel</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Příručka k aplikaci Genius"><link rel="up" href="ch11.html" title="Chapter 11. Seznam funkcí GEL"><link rel="prev" href="ch11s06.html" title="Trigonometrie"><link rel="next" href="ch11s08.html" title="Práce s maticemi"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Teorie čísel</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch11s06.html">Prev</a> </td><th width="60%" align="center">Chapter 11. Seznam funkcí GEL</th><td width="20%" align="right"> <a accesskey="n" href="ch11s08.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="genius-gel-function-list-number-theory"></a>Teorie čísel</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a name="gel-function-AreRelativelyPrime"></a>AreRelativelyPrime</span></dt><dd><pre class="synopsis">AreRelativelyPrime (a,b)</pre><p>Jsou reálná celá čísla <code class="varname">a</code> a <code class="varname">b</code> nesoudělná? Vrací <code class="constant">true</code> nebo <code class="constant">false</code>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/RelativelyPrime" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/RelativelyPrime.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Nesoud%C4%9Bln%C3%A1_%C4%8D%C3%ADsla" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-BernoulliNumber"></a>BernoulliNumber</span></dt><dd><pre class="synopsis">BernoulliNumber (n)</pre><p>Vrátit <code class="varname">n</code>-té Bernoulliho číslo.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="https://en.wikipedia.org/wiki/Bernoulli_number" target="_top">Wikipedia</a> (text je v angličtině) a <a class="ulink" href="http://mathworld.wolfram.com/BernoulliNumber.html" target="_top">Mathworld</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-ChineseRemainder"></a>ChineseRemainder</span></dt><dd><pre class="synopsis">ChineseRemainder (a,m)</pre><p>Alternativní názvy: <code class="function">CRT</code></p><p>Najít pomocí čínské věty o zbytcích <code class="varname">x</code>, které řeší systém zadaný vektorem <code class="varname">a</code>, a zbytky prvků <code class="varname">m</code>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/ChineseRemainderTheorem" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/ChineseRemainderTheorem.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/%C4%8C%C3%ADnsk%C3%A1_v%C4%9Bta_o_zbytc%C3%ADch" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-CombineFactorizations"></a>CombineFactorizations</span></dt><dd><pre class="synopsis">CombineFactorizations (a,b)</pre><p>Jsou-li dány dva rozklady, vrátit rozklad (faktorizaci) součinu.</p><p>Viz <a class="link" href="ch11s07.html#gel-function-Factorize">Factorize</a>.</p></dd><dt><span class="term"><a name="gel-function-ConvertFromBase"></a>ConvertFromBase</span></dt><dd><pre class="synopsis">ConvertFromBase (v,b)</pre><p>Převést vektor hodnot udávajících mocniny <code class="varname">b</code> na číslo.</p></dd><dt><span class="term"><a name="gel-function-ConvertToBase"></a>ConvertToBase</span></dt><dd><pre class="synopsis">ConvertToBase (n,b)</pre><p>Převést číslo na vektor mocnin prvků o základu <code class="varname">b</code>.</p></dd><dt><span class="term"><a name="gel-function-DiscreteLog"></a>DiscreteLog</span></dt><dd><pre class="synopsis">DiscreteLog (n,b,q)</pre><p>Najít diskrétní logaritmus <code class="varname">n</code> o základu <code class="varname">b</code> v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>, kde <code class="varname">q</code> je prvočíslo, pomocí Silverova-Pohligova-Hellmanova algoritmu.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/DiscreteLogarithm" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/DiscreteLogarithm.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Diskr%C3%A9tn%C3%AD_logaritmus" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-Divides"></a>Divides</span></dt><dd><pre class="synopsis">Divides (m,n)</pre><p>Zkontrolovat dělitelnost (zda <code class="varname">m</code> dělí <code class="varname">n</code>).</p></dd><dt><span class="term"><a name="gel-function-EulerPhi"></a>EulerPhi</span></dt><dd><pre class="synopsis">EulerPhi (n)</pre><p>Spočítat Eulerovu funkci fí pro <code class="varname">n</code>, to je počet celých čísel mezi 1 a <code class="varname">n</code>, relativně prvočíselných vůči <code class="varname">n</code>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/EulerPhifunction" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/TotientFunction.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Eulerova_funkce" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-ExactDivision"></a>ExactDivision</span></dt><dd><pre class="synopsis">ExactDivision (n,d)</pre><p lang="en">
Return <strong class="userinput"><code>n/d</code></strong> but only if <code class="varname">d</code>
divides <code class="varname">n</code>. If <code class="varname">d</code>
does not divide <code class="varname">n</code> then this function returns
garbage. This is a lot faster for very large numbers
than the operation <strong class="userinput"><code>n/d</code></strong>, but it is only
useful if you know that the division is exact.
</p></dd><dt><span class="term"><a name="gel-function-Factorize"></a>Factorize</span></dt><dd><pre class="synopsis">Factorize (n)</pre><p lang="en">
Return factorization of a number as a matrix. The first
row is the primes in the factorization (including 1) and the
second row are the powers. So for example:
</p><pre lang="en" class="screen"><code class="prompt">genius></code> <strong class="userinput"><code>Factorize(11*11*13)</code></strong>
=
[1 11 13
1 2 1]</pre><p lang="en">
</p><p>Více informací najdete v encyklopedii <a class="ulink" href="https://cs.wikipedia.org/wiki/Faktorizace" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-Factors"></a>Factors</span></dt><dd><pre class="synopsis">Factors (n)</pre><p lang="en">
Return all factors of <code class="varname">n</code> in a vector. This
includes all the non-prime factors as well. It includes 1 and the
number itself. So to print all the perfect numbers
(those that are sums of their factors) up to the number 1000 you
could do (this is clearly very inefficient)
</p><pre lang="en" class="programlisting">for n=1 to 1000 do (
if MatrixSum (Factors(n)) == 2*n then
print(n)
)
</pre><p lang="en">
</p></dd><dt><span class="term"><a name="gel-function-FermatFactorization"></a>FermatFactorization</span></dt><dd><pre class="synopsis">FermatFactorization (n,pokusy)</pre><p>Zkusit Fermatův rozklad <code class="varname">n</code> na <strong class="userinput"><code>(t-s)*(t+s)</code></strong>. Pokud to je možné, vrací <code class="varname">t</code> a <code class="varname">s</code> jako vektor, jinak vrací <code class="constant">null</code>. Argument <code class="varname">pokusy</code> určuje počet pokusu, než se výpočet vzdá.</p><p>Jedná se o docela dobrý rozklad za předpokladu, že je vaše číslo součinem dvou přibližně stejně velkých čísel.</p><p>Více informací najdete v encyklopedii <a class="ulink" href="https://en.wikipedia.org/wiki/Fermat_factorization" target="_top">Wikipedia</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-FindPrimitiveElementMod"></a>FindPrimitiveElementMod</span></dt><dd><pre class="synopsis">FindPrimitiveElementMod (q)</pre><p>Najít první primitivní prvek v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>. Je samozřejmé, že <code class="varname">q</code> musí být prvočíslo.</p></dd><dt><span class="term"><a name="gel-function-FindRandomPrimitiveElementMod"></a>FindRandomPrimitiveElementMod</span></dt><dd><pre class="synopsis">FindRandomPrimitiveElementMod (q)</pre><p>Najít náhodný primitivní prvek v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>. Je samozřejmé, že <code class="varname">q</code> musí být prvočíslo.</p></dd><dt><span class="term"><a name="gel-function-IndexCalculus"></a>IndexCalculus</span></dt><dd><pre class="synopsis">IndexCalculus (n,b,q,S)</pre><p>Spočítat diskrétní logaritmus <code class="varname">n</code> o základu <code class="varname">b</code> v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code> (<code class="varname">q</code> prvočíslo) pomocí faktorizační báze <code class="varname">S</code>. <code class="varname">S</code> by měl být sloupec prvočísel, pokud možno s druhým sloupcem předpočítaným pomocí <a class="link" href="ch11s07.html#gel-function-IndexCalculusPrecalculation"><code class="function">IndexCalculusPrecalculation</code></a>.</p></dd><dt><span class="term"><a name="gel-function-IndexCalculusPrecalculation"></a>IndexCalculusPrecalculation</span></dt><dd><pre class="synopsis">IndexCalculusPrecalculation (b,q,S)</pre><p>Provést přípravný krok výpočtu funkce <a class="link" href="ch11s07.html#gel-function-IndexCalculus"><code class="function">IndexCalculus</code></a> pro logaritmy o základu <code class="varname">b</code> v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code> (<code class="varname">q</code> prvočíslo), pro faktorizační bázi <code class="varname">S</code> (kde <code class="varname">S</code> je sloupcový vektor prvočísel). Logaritmy budou předpočítány a vráceny v druhém sloupci.</p></dd><dt><span class="term"><a name="gel-function-IsEven"></a>IsEven</span></dt><dd><pre class="synopsis">IsEven (n)</pre><p>Otestovat, zda je celé číslo sudé.</p></dd><dt><span class="term"><a name="gel-function-IsMersennePrimeExponent"></a>IsMersennePrimeExponent</span></dt><dd><pre class="synopsis">IsMersennePrimeExponent (p)</pre><p>Zjistit, jestli je kladné celé číslo <code class="varname">p</code> Mersennovo prvočíslo. Tj. zda 2<sup>p</sup>-1 je prvočíslo. Provádí se to hledáním v tabulce známých hodnot, která je relativně krátká. Viz také <a class="link" href="ch11s07.html#gel-function-MersennePrimeExponents">MersennePrimeExponents</a> a <a class="link" href="ch11s07.html#gel-function-LucasLehmer">LucasLehmer</a>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/MersenneNumbers" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/MersennePrime.html" target="_top">Mathworld</a> (text je v angličtině), <a class="ulink" href="http://www.mersenne.org/" target="_top">GIMPS</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Mersennovo_prvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-IsNthPower"></a>IsNthPower</span></dt><dd><pre class="synopsis">IsNthPower (m,n)</pre><p>Zjistit, jestli je racionální číslo <code class="varname">m</code> perfektní <code class="varname">n</code>-tou mocninou . Viz také <a class="link" href="ch11s07.html#gel-function-IsPerfectPower">IsPerfectPower</a> a <a class="link" href="ch11s07.html#gel-function-IsPerfectSquare">IsPerfectSquare</a>.</p></dd><dt><span class="term"><a name="gel-function-IsOdd"></a>IsOdd</span></dt><dd><pre class="synopsis">IsOdd (n)</pre><p>Otestovat, zda je celé číslo liché.</p></dd><dt><span class="term"><a name="gel-function-IsPerfectPower"></a>IsPerfectPower</span></dt><dd><pre class="synopsis">IsPerfectPower (n)</pre><p>Zkontrolovat, zda je celé číslo perfekntí mocninou a<sup>b</sup>.</p></dd><dt><span class="term"><a name="gel-function-IsPerfectSquare"></a>IsPerfectSquare</span></dt><dd><pre class="synopsis">IsPerfectSquare (n)</pre><p lang="en">
Check an integer for being a perfect square of an integer. The number must
be an integer. Negative integers are never perfect
squares of integers.
</p></dd><dt><span class="term"><a name="gel-function-IsPrime"></a>IsPrime</span></dt><dd><pre class="synopsis">IsPrime (n)</pre><p lang="en">
Tests primality of integers, for numbers less than 2.5e10 the
answer is deterministic (if Riemann hypothesis is true). For
numbers larger, the probability of a false positive
depends on
<a class="link" href="ch11s03.html#gel-function-IsPrimeMillerRabinReps">
<code class="function">IsPrimeMillerRabinReps</code></a>. That
is the probability of false positive is 1/4 to the power
<code class="function">IsPrimeMillerRabinReps</code>. The default
value of 22 yields a probability of about 5.7e-14.
</p><p lang="en">
If <code class="constant">false</code> is returned, you can be sure that
the number is a composite. If you want to be absolutely sure
that you have a prime you can use
<a class="link" href="ch11s07.html#gel-function-MillerRabinTestSure">
<code class="function">MillerRabinTestSure</code></a> but it may take
a lot longer.
</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/PrimeNumber" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/PrimeNumber.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/Prvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-IsPrimitiveMod"></a>IsPrimitiveMod</span></dt><dd><pre class="synopsis">IsPrimitiveMod (g,q)</pre><p>Zkontrolovat, zda je <code class="varname">g</code> primitivní v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>, kde <code class="varname">q</code> je prvočíslo. Pokud <code class="varname">q</code> není prvočíslo, jsou výsledky nesmyslné.</p></dd><dt><span class="term"><a name="gel-function-IsPrimitiveModWithPrimeFactors"></a>IsPrimitiveModWithPrimeFactors</span></dt><dd><pre class="synopsis">IsPrimitiveModWithPrimeFactors (g,q,f)</pre><p>Zkontrolovat, zda je <code class="varname">g</code> primitivní v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>, kde <code class="varname">q</code> je prvočíslo a <code class="varname">f</code> je vektor prvočíselných činitelů <code class="varname">q</code>-1. Pokud <code class="varname">q</code> není prvočíslo, jsou výsledky nesmyslné.</p></dd><dt><span class="term"><a name="gel-function-IsPseudoprime"></a>IsPseudoprime</span></dt><dd><pre class="synopsis">IsPseudoprime (n,b)</pre><p>Zda je <code class="varname">n</code> pseudoprvočíslo o základu <code class="varname">b</code>, ale ne prvočíslo, tj. jestli <strong class="userinput"><code>b^(n-1) == 1 mod n</code></strong>. Volá se funkce <a class="link" href="ch11s07.html#gel-function-PseudoprimeTest"><code class="function">PseudoprimeTest</code></a>.</p></dd><dt><span class="term"><a name="gel-function-IsStrongPseudoprime"></a>IsStrongPseudoprime</span></dt><dd><pre class="synopsis">IsStrongPseudoprime (n,b)</pre><p>Zjistit, zda je <code class="varname">n</code> silné pseudoprvočíslo o základu <code class="varname">b</code>, ale ne prvočíslo.</p></dd><dt><span class="term"><a name="gel-function-Jacobi"></a>Jacobi</span></dt><dd><pre class="synopsis">Jacobi (a,b)</pre><p>Alternativní názvy: <code class="function">JacobiSymbol</code></p><p>Spočítat Jacobiho symbol (a/b) (b by mělo být liché).</p></dd><dt><span class="term"><a name="gel-function-JacobiKronecker"></a>JacobiKronecker</span></dt><dd><pre class="synopsis">JacobiKronecker (a,b)</pre><p>Alternativní názvy: <code class="function">JacobiKroneckerSymbol</code></p><p>Spočítat Jacobiho symbol (a/b) s Kroneckerovým rozšířením (a/2)=(2/a), když <code class="varname">a</code> je liché, nebo (a/2)=0, když <code class="varname">a</code> je sudé.</p></dd><dt><span class="term"><a name="gel-function-LeastAbsoluteResidue"></a>LeastAbsoluteResidue</span></dt><dd><pre class="synopsis">LeastAbsoluteResidue (a,n)</pre><p>Vrátit zbytek <code class="varname">a</code> mod <code class="varname">n</code> s nejmenší absolutní hodnotou (v intervalu -n/2 až n/2).</p></dd><dt><span class="term"><a name="gel-function-Legendre"></a>Legendre</span></dt><dd><pre class="synopsis">Legendre (a,p)</pre><p>Alternativní názvy: <code class="function">LegendreSymbol</code></p><p>Spočítat Legendrův symbol (a/p).</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/LegendreSymbol" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/LegendreSymbol.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Legendre%C5%AFv_symbol" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-LucasLehmer"></a>LucasLehmer</span></dt><dd><pre class="synopsis">LucasLehmer (p)</pre><p>Zjistit pomocí Lucasova-Lehmerova testu, zda je 2<sup>p</sup>-1 Mersennovo prvočíslo. Viz také <a class="link" href="ch11s07.html#gel-function-MersennePrimeExponents">MersennePrimeExponents</a> a <a class="link" href="ch11s07.html#gel-function-IsMersennePrimeExponent">IsMersennePrimeExponent</a>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="https://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test" target="_top">Wikipedia</a> (text je v angličtině), <a class="ulink" href="http://planetmath.org/LucasLhemer" target="_top">Planetmath</a> (text je v angličtině) a <a class="ulink" href="http://mathworld.wolfram.com/Lucas-LehmerTest.html" target="_top">Mathworld</a> (text je v agličtině).</p></dd><dt><span class="term"><a name="gel-function-LucasNumber"></a>LucasNumber</span></dt><dd><pre class="synopsis">LucasNumber (n)</pre><p>Vrátit <code class="varname">n</code>-té Lucasovo číslo.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="https://en.wikipedia.org/wiki/Lucas_number" target="_top">Wikipedia</a> (text je v angličtině), <a class="ulink" href="http://planetmath.org/LucasNumbers" target="_top">Planetmath</a> (text je v angličtině) a <a class="ulink" href="http://mathworld.wolfram.com/LucasNumber.html" target="_top">Mathworld</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-MaximalPrimePowerFactors"></a>MaximalPrimePowerFactors</span></dt><dd><pre class="synopsis">MaximalPrimePowerFactors (n)</pre><p>Vrátit všechny maximální mocniny prvočísel v rozkladu čísla.</p></dd><dt><span class="term"><a name="gel-function-MersennePrimeExponents"></a>MersennePrimeExponents</span></dt><dd><pre class="synopsis">MersennePrimeExponents</pre><p>Vektor se známými exponenty Mersennových prvočísel, což je seznam kladných celých čísel <code class="varname">p</code> takových, že 2<sup>p</sup>-1 je prvočíslo. Viz také <a class="link" href="ch11s07.html#gel-function-IsMersennePrimeExponent">IsMersennePrimeExponent</a> a <a class="link" href="ch11s07.html#gel-function-LucasLehmer">LucasLehmer</a>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/MersenneNumbers" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/MersennePrime.html" target="_top">Mathworld</a> (text je v angličtině), <a class="ulink" href="http://www.mersenne.org/" target="_top">GIMPS</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Mersennovo_prvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-MillerRabinTest"></a>MillerRabinTest</span></dt><dd><pre class="synopsis">MillerRabinTest (n,opak)</pre><p lang="en">
Use the Miller-Rabin primality test on <code class="varname">n</code>,
<code class="varname">reps</code> number of times. The probability of false
positive is <strong class="userinput"><code>(1/4)^reps</code></strong>. It is probably
usually better to use
<a class="link" href="ch11s07.html#gel-function-IsPrime">
<code class="function">IsPrime</code></a> since that is faster and
better on smaller integers.
</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/MillerRabinPrimeTest" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Miller%C5%AFv-Rabin%C5%AFv_test_prvo%C4%8D%C3%ADselnosti" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-MillerRabinTestSure"></a>MillerRabinTestSure</span></dt><dd><pre class="synopsis">MillerRabinTestSure (n)</pre><p>Použít Millerův-Rabinův test prvočíselnosti na <code class="varname">n</code> s tolika bázemi, že za předpokladu zobecněné Riemannovy hypotézy je výsledek deterministický.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/MillerRabinPrimeTest" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Miller%C5%AFv-Rabin%C5%AFv_test_prvo%C4%8D%C3%ADselnosti" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-ModInvert"></a>ModInvert</span></dt><dd><pre class="synopsis">ModInvert (n,m)</pre><p>Vrátit převrácenou hodnotu n mod m.</p><p>Více informací najdete v encyklopedii <a class="ulink" href="http://mathworld.wolfram.com/ModularInverse.html" target="_top">Mathworld</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-MoebiusMu"></a>MoebiusMu</span></dt><dd><pre class="synopsis">MoebiusMu (n)</pre><p>Vrátit Möbiovu funkci μ vyhodnocenu na <code class="varname">n</code>. Což znamená, že vrátí 0 v případě, že <code class="varname">n</code> není součin různých prvočísel, a <strong class="userinput"><code>(-1)^k</code></strong> v případě, že je součin <code class="varname">k</code> různých prvočísel.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/MoebiusFunction" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/MoebiusFunction.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/M%C3%B6biova_funkce" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-NextPrime"></a>NextPrime</span></dt><dd><pre class="synopsis">NextPrime (n)</pre><p>Vrátit nejmenší prvočíslo větší než <code class="varname">n</code>. Záporná prvočísla jsou považována za prvočísla, takže předchozí prvočíslo můžete získat jako <strong class="userinput"><code>-NextPrime(-n)</code></strong>.</p><p>Tato funkce používá funkci <code class="function">mpz_nextprime</code> z knihovny GMP, která zase používá pravděpodobnostní Millerův-Rabinův test (viz také <a class="link" href="ch11s07.html#gel-function-MillerRabinTest"><code class="function">MillerRabinTest</code></a>). Pravděpodobnost falešné kladné odpovědi není nastavitelná, ale je dostatečně malá pro praktické účely.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/PrimeNumber" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/PrimeNumber.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/Prvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-PadicValuation"></a>PadicValuation</span></dt><dd><pre class="synopsis">PadicValuation (n,p)</pre><p>Vrátit p-adické ohodnocení (počet koncových nul v základu <code class="varname">p</code>).</p><p>Více informací najdete v encyklopediích <a class="ulink" href="https://en.wikipedia.org/wiki/P-adic_order" target="_top">Wikipedia</a> (text je v angličtině) a <a class="ulink" href="http://planetmath.org/PAdicValuation" target="_top">Planetmath</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-PowerMod"></a>PowerMod</span></dt><dd><pre class="synopsis">PowerMod (a,b,m)</pre><p>Spočítat <strong class="userinput"><code>a^b mod m</code></strong>. <code class="varname">b</code>-tá mocnina čísla <code class="varname">a</code> modulo <code class="varname">m</code>. Tuto funkci není nutné používat, protože se automaticky použije v režimu modulární aritmetiky. Z tohoto důvodu je <strong class="userinput"><code>a^b mod m</code></strong> stejně rychlé.</p></dd><dt><span class="term"><a name="gel-function-Prime"></a>Prime</span></dt><dd><pre class="synopsis">Prime (n)</pre><p>Alternativní názvy: <code class="function">prime</code></p><p>Vrátit <code class="varname">n</code>-té prvočíslo (až do limitu).</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/PrimeNumber" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/PrimeNumber.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/Prvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-PrimeFactors"></a>PrimeFactors</span></dt><dd><pre class="synopsis">PrimeFactors (n)</pre><p>Vrátit v podobě vektoru všechny prvočinitele čísla.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://mathworld.wolfram.com/PrimeFactor.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://en.wikipedia.org/wiki/Prime_factor" target="_top">Wikipedia</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-PseudoprimeTest"></a>PseudoprimeTest</span></dt><dd><pre class="synopsis">PseudoprimeTest (n,b)</pre><p lang="en">Pseudoprime test, returns <code class="constant">true</code> if and only if
<strong class="userinput"><code>b^(n-1) == 1 mod n</code></strong></p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/Pseudoprime" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/Pseudoprime.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/Pseudoprvo%C4%8D%C3%ADslo" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-RemoveFactor"></a>RemoveFactor</span></dt><dd><pre class="synopsis">RemoveFactor (n,m)</pre><p>Odstranit všechny instance činitele <code class="varname">m</code> z čísla <code class="varname">n</code>. Prakticky to znamená, že je poděleno nejvyšší mocninou čísla <code class="varname">m</code>, která je dělitelem <code class="varname">n</code>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/Divisibility" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/Factor.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="http://cs.wikipedia.org/wiki/D%C4%9Blitelnost" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-SilverPohligHellmanWithFactorization"></a>SilverPohligHellmanWithFactorization</span></dt><dd><pre class="synopsis">SilverPohligHellmanWithFactorization (n,b,q,f)</pre><p>Najít diskrétní logaritmus <code class="varname">n</code> o základu <code class="varname">b</code> v F<sub>q</sub>, konečné grupě řádu <code class="varname">q</code>, kde <code class="varname">q</code> je prvočíslo, pomocí Silverova-Pohligova-Hellmanova algoritmu, dané <code class="varname">f</code> je rozkladem <code class="varname">q</code>-1.</p></dd><dt><span class="term"><a name="gel-function-SqrtModPrime"></a>SqrtModPrime</span></dt><dd><pre class="synopsis">SqrtModPrime (n,p)</pre><p>Najít druhou odmocninu z <code class="varname">n</code> modulo <code class="varname">p</code> (kde <code class="varname">p</code> je prvočíslo). Pokud není kvadratickým zbytkem, je vráceno null.</p><p>Více informací najdete v encyklopedicíh <a class="ulink" href="http://planetmath.org/QuadraticResidue" target="_top">Planetmath</a> (text je v angličtině) a <a class="ulink" href="http://mathworld.wolfram.com/QuadraticResidue.html" target="_top">Mathworld</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-StrongPseudoprimeTest"></a>StrongPseudoprimeTest</span></dt><dd><pre class="synopsis">StrongPseudoprimeTest (n,b)</pre><p>Spustit silný test pseudoprvočíselnosti o základu <code class="varname">b</code> na <code class="varname">n</code>.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/StrongPseudoprime" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/StrongPseudoprime.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://en.wikipedia.org/wiki/Strong_pseudoprime" target="_top">Wikipedia</a> (text je v angličtině).</p></dd><dt><span class="term"><a name="gel-function-gcd"></a>gcd</span></dt><dd><pre class="synopsis">gcd (a,argumenty...)</pre><p>Alternativní názvy: <code class="function">GCD</code></p><p>Největší společný dělitel celých čísel. V seznamu argumentů můžete uvést libovolný počet celých čísel, nebo je můžete zadat jako vektor nebo matici celých čísel. Pokud zadáte více než jednu matici stejné velikosti, bude největší společný dělitel určen prvek po prvku.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/GreatestCommonDivisor" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/GreatestCommonDivisor.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Nejv%C4%9Bt%C5%A1%C3%AD_spole%C4%8Dn%C3%BD_d%C4%9Blitel" target="_top">Wikipedia</a>.</p></dd><dt><span class="term"><a name="gel-function-lcm"></a>lcm</span></dt><dd><pre class="synopsis">lcm (a,argumenty...)</pre><p>Alternativní názvy: <code class="function">LCM</code></p><p>Nejmenší společný násobek celých čísel. V seznamu argumentů můžete uvést libovolný počet celých čísel, nebo je můžete zadat jako vektor nebo matici celých čísel. Pokud zadáte více než jednu matici stejné velikosti, bude nejmenší společný násobek určen prvek po prvku.</p><p>Více informací najdete v encyklopediích <a class="ulink" href="http://planetmath.org/LeastCommonMultiple" target="_top">Planetmath</a> (text je v angličtině), <a class="ulink" href="http://mathworld.wolfram.com/LeastCommonMultiple.html" target="_top">Mathworld</a> (text je v angličtině) a <a class="ulink" href="https://cs.wikipedia.org/wiki/Nejmen%C5%A1%C3%AD_spole%C4%8Dn%C3%BD_n%C3%A1sobek" target="_top">Wikipedia</a>.</p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch11s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch11.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch11s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Trigonometrie </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Práce s maticemi</td></tr></table></div></body></html>
|