mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-12 19:47:53 +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/lcm_sum.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');
|
||||
@@ -97,7 +97,8 @@ $(document).ready(function(){initNavTree('d5/d83/lcm__sum_8cpp.html','../../');
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\).
|
||||
<p>An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) +
|
||||
\mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\).
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
@@ -126,9 +127,12 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\). </p>
|
||||
<p >An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\) where \(\mathrm{LCM}(i,n)\) denotes the Least Common Multiple of the integers i and n. For n greater than or equal to 1. The value of the sum is calculated by formula: </p><p class="formulaDsp">
|
||||
\[ \sum\mathrm{LCM}(i, n) = \frac{1}{2} \left[\left(\sum (d * \mathrm{ETF}(d)) + 1\right) * n\right] \]
|
||||
<div class="textblock"><p >An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) +
|
||||
\mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\). </p>
|
||||
<p >An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) +
|
||||
\mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\) where \(\mathrm{LCM}(i,n)\) denotes the Least Common Multiple of the integers i and n. For n greater than or equal to 1. The value of the sum is calculated by formula: </p><p class="formulaDsp">
|
||||
\[ \sum\mathrm{LCM}(i, n) = \frac{1}{2} \left[\left(\sum (d *
|
||||
\mathrm{ETF}(d)) + 1\right) * n\right] \]
|
||||
</p>
|
||||
<p> where \mathrm{ETF}(i) represents Euler totient function of i. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/chestamittal" target="_blank">Chesta Mittal</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
@@ -231,7 +235,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="../../d5/d83/lcm__sum_8cpp.html">lcm_sum.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