mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-30 08:41:30 +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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,31,49,57"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="115,5,187,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="115,5,187,32"/>
|
||||
<area shape="rect" id="node3" href="$dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244" title=" " alt="" coords="97,56,204,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
f4fe573c53a6bfd235f7f2fbe384d683
|
||||
76fa7b582dcdc0b8d8ad6b718ddc7992
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
<!-- Generated by graphviz version 3.0.0 (20220226.1711)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="157pt" height="66pt"
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="82,-38.5 82,-57.5 136,-57.5 136,-38.5 82,-38.5"/>
|
||||
<text text-anchor="middle" x="109" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,31,56,57"/>
|
||||
<area shape="rect" id="node2" href="$d5/d83/lcm__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title=" " alt="" coords="104,31,148,57"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="213,5,285,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="213,5,285,32"/>
|
||||
<area shape="rect" id="node4" href="$dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244" title=" " alt="" coords="196,56,303,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
81368068b54cc4aa861cef9e7ec49d30
|
||||
5e5751c0edbf3c72cc6f338d69c2ebba
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
<!-- Generated by graphviz version 3.0.0 (20220226.1711)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="231pt" height="66pt"
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="156,-38.5 156,-57.5 210,-57.5 210,-38.5 156,-38.5"/>
|
||||
<text text-anchor="middle" x="183" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user