Not sure if this belongs here but I can't hide the code and give credit to the original source.

When I worked for a company writing education software many moons ago on the BBC micro we had a product that would work out the polynonial function for a sequence of number. We actually used this in some crude protection schemes.

Excel offers a smaller version of this in trending so I thought I could use the principle to generate a JAPH. Limitations in Excel mean accuracy is limited to 6 characters at a time.

I dare say those with a more maths bent can get this even better.

#!/usr/local/bin/perl -w use strict; map{ eval} ('map{printf "%c" ,3.55*$_**5-57.583*$_**4+347.75*$_**3-972.92*$_**2+1 +249.2*$_-463.5}(1..6)', 'map{printf "%c", -0.55*$_**5+10.208*$_**4-69.833*$_**3+215.29*$_**2-2 +92.12*$_+247.5}(1..6)', 'map{printf "%c", 1.25*$_**5-25.333*$_**4+191.25*$_**3-672.17*$_**2+10 +99*$_-561.5}(1..6)', 'map{printf "%c", 0.5833*$_**5-9.4583*$_**4+56.167*$_**3-148.54*$_**2+ +169.25*$_+36.5}(1..6)'); print "\n"
Note I'm not a mathematician so if this is named wrongly and someone else already has this then I appologise.

Update

With some playing I have this down to

for('3.55*$i**5-57.583*$i**4+347.75*$i**3-972.92*$i**2+1249.2*$i-463.5 +','-0.55*$i**5+10.208*$i**4-69.833*$i**3+215.29*$i**2-292.12*$i+247.5 +','1.25*$i**5-25.333*$i**4+191.25*$i**3-672.17*$i**2+1099*$i-561.5',' +0.5833*$i**5-9.4583*$i**4+56.167*$i**3-148.54*$i**2+169.25*$i+36.5'){ +{for$i(1..6){printf"%c",eval$_}}};
Update 2 This is now at 306 chars.
map{$i=$_%6+1;print chr${[3.55*$i**5-57.583*$i**4+347.75*$i**3-972.92* +$i**2+1249.2*$i-463.5,-0.55*$i**5+10.208*$i**4-69.833*$i**3+215.29*$i +**2-292.12*$i+247.5,1.25*$i**5-25.333*$i**4+191.25*$i**3-672.17*$i**2 ++1099*$i-561.5,0.5833*$i**5-9.4583*$i**4+56.167*$i**3-148.54*$i**2+16 +9.25*$i+36.5]}[$_/6]}(0..23)
Update 3 Shaved another char off (305)
map{print chr${[3.55*++($i=$_%6)**5-57.583*$i**4+347.75*$i**3-972.92*$ +i**2+1249.2*$i-463.5,-0.55*$i**5+10.208*$i**4-69.833*$i**3+215.29*$i* +*2-292.12*$i+247.5,1.25*$i**5-25.333*$i**4+191.25*$i**3-672.17*$i**2+ +1099*$i-561.5,0.5833*$i**5-9.4583*$i**4+56.167*$i**3-148.54*$i**2+169 +.25*$i+36.5]}[$_/6]}(0..23)

In reply to Polynomial JAPH by tweetiepooh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.