Post Reply 
Short & Sweet Math Challenge #21: Powers that be
11-02-2016, 11:19 PM (This post was last modified: 11-02-2016 11:34 PM by Gerson W. Barbosa.)
Post: #10
RE: Short & Sweet Math Challenge #21: Powers that be
(11-02-2016 10:08 PM)Valentin Albillo Wrote:  .
Hi, Gerson !

I'm truly glad to get your always valuable contributions to one of my S&SMC's, as in the good old times. A few comments:

(11-02-2016 05:47 AM)Gerson W. Barbosa Wrote:  HP 50g, 181.5 bytes, 14 seconds. Only 6 constants, though.

Why only 6 ? Not being versed in RPL I don't fully understand your code but I also don't see any reference to the maximum degree for the polynomials, which should be 8.

Quote:'X^3.+0.*X^2.+-1.*X-1.'              1.32471795724 
'X^4.+-1.*X^3.+0.*X^2.-1.'           1.3802775691 
'X^5.+-1.*X^4.+-1.*X^3.+X^2.-1.'     1.44326879127 
'X^6.+-1.*X^5.+-1.*X^4.+X^2.-1.'     1.50159480354 
'X^7.+-1.*X^6.+-1.*X^5.+X^2.-1.'     1.54521564973 
'X^8.+-1.*X^7.+-1.*X^6.+X^2.-1.'     1.57367896839

Hello, Valentin!

Thanks for starting Season 2. I'm looking forward for the next episodes. I've always appreciated your insightful and well-thought S&SMC series, even though most of the time I was able to solve only the easier items.

Regarding this particular problem, I remember Phi belongs to a special set of numbers named after a French mathematician which produce near-integers when raised to high powers. I misspelled his name, but Google pointed me to the right reference wherein I found three polynomials that generate such numbers. The RPL program uses only the first generating polynomial.

PEVAL creates a symbolic polynomial expression from a variable name and a coefficents vector. For instance,

[ 1 1 1 ] 'X' PEVAL --> '1+(1+X)*x' FACTOR --> 'X²+X+1'

PROOT might be a better alternative to ZEROS, but I couldn't find a built-in inverse to PEVAL so PROOT could be used. Anyway, I guess this is not the kind of solution your looking for, so I won't proceed with this approach any longer.

(11-02-2016 10:08 PM)Valentin Albillo Wrote:  Also, even within this limited range, your program is missing two constants, one between 1.50.. and 1.54.. and another between 1.54.. and 1.57.., perhaps due to the typo that J-F pointed out (which I duly corrected) about the coefficients being -1, 0, or +1 (the '0' was missing in my OP).

Yes, I was aware of the missing constants. By using the third generating polynomial in the aforementioned reference, a few more can be found:

%%HP: T(3)A(R)F(.);
\<< 3. 8.
  FOR n X n ^ X n 1. + ^ 1. - X 2. ^ 1. - / - DUP 'X' ZEROS DUP SIZE GET
  NEXT
\>>

TEVAL

'X^3.-(X^4.-1.)/(X^2.-1.)' 
             1.46557123188 
'X^4.-(X^5.-1.)/(X^2.-1.)' 
             1.53415774491 
'X^5.-(X^6.-1.)/(X^2.-1.)' 
              1.5701473122 
'X^6.-(X^7.-1.)/(X^2.-1.)' 
              1.5900053739 
'X^7.-(X^8.-1.)/(X^2.-1.)' 
             1.60134733379 
'X^8.-(X^9.-1.)/(X^2.-1.)'  
             1.60798272793 
               :s: 18.1289


Not in the required format, though. Also, the polynomial have yet to be simplified and checked whether the degrees are no greater than 8.

Best regards,

Gerson.

Edited to fix a typo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Short & Sweet Math Challenge #21: Powers that be - Gerson W. Barbosa - 11-02-2016 11:19 PM



User(s) browsing this thread: 1 Guest(s)