mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-24 02:23:10 +08:00
Documentation for 2a076c1b03
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: math/eulers_totient_function.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<!-- Generated by Doxygen 1.9.4 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -118,7 +118,8 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >C++ Program to find <a href="https://en.wikipedia.org/wiki/Euler%27s_totient_function" target="_blank">Euler's Totient</a> function. </p>
|
||||
<p >Euler Totient Function is also known as phi function. </p><p class="formulaDsp">
|
||||
\[\phi(n) = \phi\left({p_1}^{a_1}\right)\cdot\phi\left({p_2}^{a_2}\right)\ldots\]
|
||||
\[\phi(n) =
|
||||
\phi\left({p_1}^{a_1}\right)\cdot\phi\left({p_2}^{a_2}\right)\ldots\]
|
||||
</p>
|
||||
<p> where \(p_1\), \(p_2\), \(\ldots\) are prime factors of n. <br />
|
||||
3 Euler's properties:</p><ol type="1">
|
||||
@@ -127,7 +128,8 @@ Functions</h2></td></tr>
|
||||
<li>\(\phi(a,b) = \phi(a)\cdot\phi(b)\) where a and b are relative primes.</li>
|
||||
</ol>
|
||||
<p >Applying this 3 properties on the first equation. </p><p class="formulaDsp">
|
||||
\[\phi(n) = n\cdot\left(1-\frac{1}{p_1}\right)\cdot\left(1-\frac{1}{p_2}\right)\cdots\]
|
||||
\[\phi(n) =
|
||||
n\cdot\left(1-\frac{1}{p_1}\right)\cdot\left(1-\frac{1}{p_2}\right)\cdots\]
|
||||
</p>
|
||||
<p> where \(p_1\), \(p_2\)... are prime factors. Hence Implementation in \(O\left(\sqrt{n}\right)\). <br />
|
||||
Some known values are:</p><ul>
|
||||
@@ -228,7 +230,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../da/d23/eulers__totient__function_8cpp.html">eulers_totient_function.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user