<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Some stuff &#187; integer</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=integer" rel="self" type="application/rss+xml" />
	<link>https://blog.yhuang.org</link>
	<description>here.</description>
	<lastBuildDate>Wed, 27 Aug 2025 08:50:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>a polynomial problem</title>
		<link>https://blog.yhuang.org/?p=291</link>
		<comments>https://blog.yhuang.org/?p=291#comments</comments>
		<pubDate>Mon, 22 Nov 2010 21:52:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[expansion]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[integer coefficients]]></category>
		<category><![CDATA[math math]]></category>
		<category><![CDATA[mathbb]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[number math]]></category>
		<category><![CDATA[polynomial coefficients]]></category>
		<category><![CDATA[positive integer]]></category>

		<guid isPermaLink="false">http://allegro.mit.edu/~zong/wpress/?p=291</guid>
		<description><![CDATA[The latest problem from fakalin. Took some wrong turns and hints to solve it&#8230; Given a polynomial with positive integer coefficients, how many evaluations of does it take to obtain the polynomial? (An polynomial with real coefficients would take the number of degrees plus 1 to specify, which, if it held in this case, would [...]]]></description>
			<content:encoded><![CDATA[<p>The latest problem from fakalin. Took some wrong turns and hints to solve it&#8230;</p>
<p>Given a polynomial \(f: \mathbb{Z}\to \mathbb{Z}\) with positive integer coefficients, how many evaluations of \(f\) does it take to obtain the polynomial?</p>
<p>(An \(f: \mathbb{R}\to \mathbb{R}\) polynomial with real coefficients would take the number of degrees plus 1 to specify, which, if it held in this case, would render the answer unbounded. But the correct answer in this case is surprisingly small.)<br />
<span id="more-291"></span><br />
It takes only 2 evaluations. Suppose in the following that \(b>0\). Let us note that a polynomial \(f(b) = a_n b^n + &#8230; + a_0 b^0\) specifies essentially a base \(b\) representation of the number \(f(b)\), in that \(a_n a_{n-1} &#8230; a_0\) is an expansion of \(f(b)\) in base \(b\). The only problem is this expansion is non-unique, as it is possible for any \(a_j \ge b\).</p>
<p>However, it is not possible for any \(a_j \ge f(b) + 1\), since for all \(j\), \(f(b) \ge a_j\) by the problem statement and assumption on \(b\). Then take \(B = f(b) + 1\). Now we are guaranteed that \(a_n a_{n-1} &#8230; a_0\) is the unique (and canonical) base \(B\) expansion of \(f(B)\), from which the polynomial coefficients immediately obtain.</p>
<p>So the two evaluations are at \(f(b)\) and \(f(B=f(b)+1)\).</p>
<p>Example: \(f(b) = 3b^2 + 2b + 1\). Evaluate at, e.g., \(b=1\) to get \(f(1) = 6\). Then evaluate at \(B=f(1)+1=7\) to get \(f(7)=162=321_{7}\).</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=291</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>double log convergence</title>
		<link>https://blog.yhuang.org/?p=156</link>
		<comments>https://blog.yhuang.org/?p=156#comments</comments>
		<pubDate>Wed, 04 Feb 2009 05:22:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2m]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[convergence speed]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[integer math]]></category>
		<category><![CDATA[math log]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[sqrt]]></category>
		<category><![CDATA[square root]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=156</guid>
		<description><![CDATA[Here is a problem on complexity, or alternatively, convergence. If an integer is reduced by the largest square less than it each time until it is terminated at zero, show that the number of steps taken is at most order . More precisely, let and be the minimum number of steps until . Prove that [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a problem on complexity, or alternatively, convergence.</p>
<p>If an integer \(n\) is reduced by the largest square less than it each time until it is terminated at zero, show that the number of steps taken is at most order \(\log \log n\).</p>
<p>More precisely, let \(f(n) = n &#8211; {\left\lfloor{\sqrt{n}}\right\rfloor}^2\) and \(g(n)=k\) be the minimum number of steps until \(f^k(n)=0\). Prove that there exists some fixed \(A\) such that \(g(n)< A \log \log n\) for all \(n\ge 3\).<br />
<span id="more-156"></span><br />
Why is the convergence speed double log? Well, it really has to do with the fact that the remainder \(f(n)\) is of order square root of \(n\), and that ultimately has to do with the fact that the gaps between successive integer squares grow linearly. Each time \(f\) is applied to some \(n\), the remainder after the removal of the largest square is no more than the gap value between that square and the next square.</p>
<p>The proof goes something like this. \(m^2 &#8211; (m-1)^2 = 2m &#8211; 1 < 2m\), so \(f(n) \le (\left\lfloor{\sqrt{n}}\right\rfloor + 1)^2 - {\left\lfloor{\sqrt{n}}\right\rfloor}^2 < 2({\left\lfloor{\sqrt{n}}\right\rfloor + 1}) \le 2\sqrt{n} + 2 \le 4\sqrt{n}\), where the last step is valid for \(n \ge 1\). After applying \(f\) some \(k\) times iteratively, we get \(f^k(n) < \underbrace{4\sqrt{\cdots 4\sqrt{4\sqrt{n}}}}_k = 16^{\frac{1}{2} + \frac{1}{4} + \cdots + 2^{-k}} n^{2^{-k}} < 16 n^{2^{-k}}\).</p>
<p>Now, if for some \(k\), \(16 n^{2^{-k}} < 17\), then certainly there must be some \(K \le k\) such that the integer \(f^K(n) \le 16\), in which case the total number of steps to terminate is no more than \(k+4\). (For the 4, see graph below for termination cases for \(n\le 16\).)</p>
<p>Next we solve \(16 n^{2^{-k}} < 17 \) (*) for \(k\) by taking log twice, and using the monotonicity of log:</p>
\(\log 16 + 2^{-k} \log n < \log 17\),<br />
<br />
\(- k\log 2 + \log \log n < \log(\log 17-\log 16)\),<br />
<br />
\(k > \frac{\log \log n}{\log 2} &#8211; \frac{\log(\log 17 &#8211; \log 16)}{\log 2}\).</p>
<p>Clearly, if \(k > \frac{\log \log n}{\log 2}\), then (*) is satisfied, so the total number of steps required to terminate is given by \(g(n) \le \frac{\log \log n}{\log 2} + 4 < 44 \log \log n\) for \(n\ge 3\), QED.</p>
<p><img align="bottom" alt="Input: digraph G {
rankdir=LR
node [shape = circle];
{0 [style = filled, color=lightgrey] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16}
3-&gt;2-&gt;1-&gt;0
8-&gt;4-&gt;0
5-&gt;1
6-&gt;2
7-&gt;3
9-&gt;0
10-&gt;1
11-&gt;2
12-&gt;3
13-&gt;4
14-&gt;5
15-&gt;6
16-&gt;0
}" src="wp-content/cache/0c99a5af1c19fe5b8ba1543f5ab5fed9.png" />
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=156</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
