http://www.perlmonks.org?node_id=371959


in reply to (homework) Find Series from list of integers

chiburashka,
You might be able to cheat by having a look at the On-Line Encyclopedia of Integer Sequences. The problem with identifying the formula yourself is being able to constrain the possibilities. For instance does the next number depend on the previous number? To calculate the Nth number do all previous numbers up to N first? Is it linear or geometric?

To say it a different way - having a handful of numbers and being told to find the formula that generated those numbers without any additional information is nearly impossible.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: I give up
by Zero_Flop (Pilgrim) on Jul 05, 2004 at 20:57 UTC
    Slight correction, the problem is not that you can't determine an equation that will generate the sequence; the problem is there are an infinite number of possibilities.

    Basically you need to define your criteria better. The only way to do this is to understand what is generating the sequence of numbers.