Note that for any given series of numbers a1 .. ak there's a polynomial f(x) of degree less then or equal to k-1 such that f(1) == a1, f(2) == a2, etc. For obvious reasons, all the coefficients of f(x) are rational (otherwise, f(x) cannot be an integer for integer x).
Given that there's at least one function that uses only the given operations, and a finite number of such operations, there's also one that uses the smallest number of operators. But it's not necessarily unique.
I don't know whether this is helpful.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|