MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: number pattern sequence tia sal2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85398] Re: [mg85379] number pattern sequence tia sal2
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Sat, 9 Feb 2008 04:13:49 -0500 (EST)
  • References: <1963121.1202472573313.JavaMail.root@m08>
  • Reply-to: drmajorbob at bigfoot.com

list = {3, 8, 4, 9, 5, 1, 6, 2, 7};
Column[Table[(-1)^n Differences[list, n], {n, 0, -1 + Length@list}]]

{3,8,4,9,5,1,6,2,7}
{-5,4,-5,4,4,-5,4,-5}
{-9,9,-9,0,9,-9,9}
{-18,18,-9,-9,18,-18}
{-36,27,0,-27,36}
{-63,27,27,-63}
{-90,0,90}
{-90,-90}
{0}

Clear[poly]
poly[data_] :=
   Module[{differences =
         First /@ NestList[Rest@# - Most@# &, data, Length@data - 1]},
     differences.Table[
      Binomial[x - 1, k], {k, 0, Length@data - 1}] //
       Expand
     ]
one[x_] = poly[list]
Array[one, Length@list]

-128 + (5407 x)/20 - (1545 x^2)/8 + (501 x^3)/8 - (75 x^4)/8 + (
  21 x^5)/40 - 90 Binomial[-1 + x, 6] + 90 Binomial[-1 + x, 7]

{3, 8, 4, 9, 5, 1, 6, 2, 7}

two[x_] = Expand@InterpolatingPolynomial[list, x]
Array[two, Length@list]

-308 + (101389 x)/140 - (5045 x^2)/8 + (2203 x^3)/8 - (265 x^4)/4 + (
  89 x^5)/10 - (5 x^6)/8 + x^7/56

{3, 8, 4, 9, 5, 1, 6, 2, 7}

Bobby

On Thu, 07 Feb 2008 21:30:56 -0600, <ratullochjk at gmail.com> wrote:

> Greetings All
>
> I'm having some trouble figuring out a sequence of numbers using commo=
n
> Difference.
> I've figured out the polynomial for the even numbers for the sequence
> but the odd numbers have a repeating pattern which I'm not sure how to=

> create a Polynomial for.
>
> I've included my work here
> http://demos.onewithall.net/number_patterns.jpg on the even numbers
> which I've verified and they are correct.
>
> I've included the odd numbers also I started doing the sequence of
> numbers using common Difference but as you can see I get a pattern of
> repeating numbers (-5,4).
>
> How can I go about getting the polynomial for the odd numbers like I
> did for the even ones.
>
>
> Tia sal2
>
>



-- =

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Fourier Series Expansions and it's Coefficients question revised tia
  • Next by Date: Re: Re: MathLink with MS Visual Studio 2008
  • Previous by thread: number pattern sequence tia sal2
  • Next by thread: Combinatorica of Steven Skiena and the new Mathematica package