<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Project_Euler%2F110</id>
	<title>Project Euler/110 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Project_Euler%2F110"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/110&amp;action=history"/>
	<updated>2026-06-18T23:13:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Project_Euler/110&amp;diff=30601&amp;oldid=prev</id>
		<title>Admin: Create Project Euler/110 page with problem statement, mathematical approach, branch-and-bound details, and solution link (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/110&amp;diff=30601&amp;oldid=prev"/>
		<updated>2026-06-16T14:39:36Z</updated>

		<summary type="html">&lt;p&gt;Create Project Euler/110 page with problem statement, mathematical approach, branch-and-bound details, and solution link (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
In the following equation &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; are positive integers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dfrac{1}{x} + \dfrac{1}{y} = \dfrac{1}{n}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be verified that when &amp;lt;math&amp;gt;n = 1260&amp;lt;/math&amp;gt; there are 113 distinct solutions and this is the least value of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for which the total number of distinct solutions exceeds one hundred.&lt;br /&gt;
&lt;br /&gt;
What is the least value of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for which the number of distinct solutions exceeds four million?&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
&lt;br /&gt;
===Mathematical Reformulation===&lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt;\tfrac{1}{x} + \tfrac{1}{y} = \tfrac{1}{n}&amp;lt;/math&amp;gt; can be rearranged algebraically:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x - n)(y - n) = n^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each divisor pair &amp;lt;math&amp;gt;(d, n^2/d)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;n^2&amp;lt;/math&amp;gt; yields a distinct ordered solution &amp;lt;math&amp;gt;(x, y)&amp;lt;/math&amp;gt;. Because the equation is symmetric in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;, the number of distinct unordered solutions is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{solutions}(n) = \frac{d(n^2) + 1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;d(k)&amp;lt;/math&amp;gt; is the divisor-count function.&lt;br /&gt;
&lt;br /&gt;
===Divisor Count of &amp;lt;math&amp;gt;n^2&amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; has prime factorization &amp;lt;math&amp;gt;n = p_1^{a_1} p_2^{a_2} \cdots p_k^{a_k}&amp;lt;/math&amp;gt;, then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
d(n^2) = (2a_1 + 1)(2a_2 + 1) \cdots (2a_k + 1)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target condition &amp;lt;math&amp;gt;\text{solutions}(n) &amp;gt; 4\,000\,000&amp;lt;/math&amp;gt; is equivalent to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d(n^2) \ge 8\,000\,001&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optimal Structure===&lt;br /&gt;
&lt;br /&gt;
The least &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; achieving a given divisor count always uses the first &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; primes (&amp;lt;math&amp;gt;2, 3, 5, 7, 11, \dots&amp;lt;/math&amp;gt;) with exponents in non-increasing order — the largest exponents are assigned to the smallest primes. This is because swapping exponents between a larger and smaller prime would increase &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; while leaving &amp;lt;math&amp;gt;d(n^2)&amp;lt;/math&amp;gt; unchanged.&lt;br /&gt;
&lt;br /&gt;
===Branch-and-Bound Search===&lt;br /&gt;
&lt;br /&gt;
We search over exponent vectors using depth-first branch-and-bound:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;State:&amp;#039;&amp;#039;&amp;#039; current prime index &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, current exponent &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; (serving as upper bound for subsequent exponents), running product &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, and running divisor-count product &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Branching:&amp;#039;&amp;#039;&amp;#039; at each prime &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, try exponents from the current maximum down to 1. Multiply &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;p_i^e&amp;lt;/math&amp;gt; and multiply &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;(2e + 1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Upper bound for &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;:&amp;#039;&amp;#039;&amp;#039; use consecutive primes each with exponent 1 as an initial best; any branch exceeding this value is pruned.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Feasibility pruning:&amp;#039;&amp;#039;&amp;#039; if the remaining primes — even at the current exponent (the maximum allowed) — cannot multiply &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; up to the target, the branch is abandoned.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Overflow pruning:&amp;#039;&amp;#039;&amp;#039; any &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; that already equals or exceeds the current &amp;lt;math&amp;gt;\text{bestN}&amp;lt;/math&amp;gt; is skipped.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;d \ge 8\,000\,001&amp;lt;/math&amp;gt;, the candidate &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is recorded if it improves upon the best found.&lt;br /&gt;
&lt;br /&gt;
Fifteen primes suffice because &amp;lt;math&amp;gt;3^{15} = 14\,348\,907 &amp;gt; 8\,000\,001&amp;lt;/math&amp;gt;, covering the worst case where every exponent is 1.&lt;br /&gt;
&lt;br /&gt;
===Verification===&lt;br /&gt;
&lt;br /&gt;
The solution code includes built-in verification: it computes the number of solutions for &amp;lt;math&amp;gt;n = 1260&amp;lt;/math&amp;gt; (confirming 113) and finds the least &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; with over 100 solutions (confirming 1260).&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
&lt;br /&gt;
Link: https://git.charlesreid1.com/cs/euler/src/branch/main/java/Problem110.java&lt;br /&gt;
&lt;br /&gt;
==Flags==&lt;br /&gt;
&lt;br /&gt;
{{ProjectEulerFlag}}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>