<?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%2F175</id>
	<title>Project Euler/175 - 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%2F175"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/175&amp;action=history"/>
	<updated>2026-06-25T05:34:44Z</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/175&amp;diff=30868&amp;oldid=prev</id>
		<title>Admin: Automated edit (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/175&amp;diff=30868&amp;oldid=prev"/>
		<updated>2026-06-24T22:11:49Z</updated>

		<summary type="html">&lt;p&gt;Automated edit (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;
Link: https://projecteuler.net/problem=175&lt;br /&gt;
&lt;br /&gt;
Define &amp;lt;math&amp;gt;f(0) = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;f(n)&amp;lt;/math&amp;gt; to be the number of ways to write &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; as a sum of powers of 2 where no power occurs more than twice.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;math&amp;gt;f(10) = 5&amp;lt;/math&amp;gt; since there are five different ways to express 10:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10 = 8 + 2 = 8 + 1 + 1 = 4 + 4 + 2 = 4 + 2 + 2 + 1 + 1 = 4 + 4 + 1 + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be shown that for every fraction &amp;lt;math&amp;gt;p/q \; (p &amp;gt; 0, q &amp;gt; 0)&amp;lt;/math&amp;gt; there exists at least one integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;f(n)/f(n-1) = p/q&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, the smallest &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;f(n)/f(n-1) = 13/17&amp;lt;/math&amp;gt; is 241. The binary expansion of 241 is 11110001. Reading this binary number from the most significant bit to the least significant bit there are 4 one&amp;#039;s, 3 zeroes and 1 one. We shall call the string 4,3,1 the &amp;#039;&amp;#039;&amp;#039;Shortened Binary Expansion&amp;#039;&amp;#039;&amp;#039; of 241.&lt;br /&gt;
&lt;br /&gt;
Find the Shortened Binary Expansion of the smallest &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for which&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{f(n)}{f(n-1)} = \frac{123456789}{987654321}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Give your answer as comma separated integers, without any whitespaces.&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
&lt;br /&gt;
This problem connects the Stern-Brocot tree with binary representations. The function &amp;lt;math&amp;gt;f(n)&amp;lt;/math&amp;gt; counts the number of hyperbinary representations of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The ratio &amp;lt;math&amp;gt;f(n)/f(n-1)&amp;lt;/math&amp;gt; corresponds to a rational number in the Stern-Brocot tree. The path to this rational determines the Shortened Binary Expansion: each &amp;quot;L&amp;quot; (left) move corresponds to a run of 1s in the binary representation, and each &amp;quot;R&amp;quot; (right) move corresponds to a run of 0s.&lt;br /&gt;
&lt;br /&gt;
Given the target fraction &amp;lt;math&amp;gt;123456789/987654321&amp;lt;/math&amp;gt;, traverse the Stern-Brocot tree to find the path, then convert the sequence of L/R moves to run-lengths, giving the Shortened Binary Expansion.&lt;br /&gt;
&lt;br /&gt;
==Answer==&lt;br /&gt;
&lt;br /&gt;
1,13717420,8&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>