0

What is the formula to generate this number sequence : 1 , 7 , 14, 30

I'm sure this is very simple for you guys. But it's got me alittle stuck. Thanks

To clarify, I'm not an advanced maths student. I'm used to e.g. n = (n/2)*1.3 etc.

What I'm looking for is something along the lines of the below:

1n = ###### = 1
2n = ###### = 7
3n = ###### = 14

etc.

The purpose of me asking this is, this sequence generation is required for a computer function.

E.g.

for (int i = 0; i < 4; i++)
    {
        int day = i*7;
        Console.WriteLine(i);
    }

Hopefully this will make it more clear the sort of equation I need.

  • 1
    maybe try $a_n=1.33n^3-7.5n^2+19.166n-12 $ – TheDragonReborn Oct 22 '14 at 11:44
  • There's too little information here to give a meaningful answer. – Hans Lundmark Oct 22 '14 at 11:47
  • that is assume $a_n=An^3+Bn^2+Cn+D$ apply given valuer for $n=1,2,3,4$ got 4 equation and 4 variable,solve it.... as Hans said it,there can be infinite answer to this question – TheDragonReborn Oct 22 '14 at 11:50
  • @Half-Bloodprince How does the formula you mentioned work, as I don't really understand the placement of "a", "B", "C", "D". Could you please run through it. Thanks :-) – StuckonaFormula Oct 22 '14 at 11:54
  • $a_n$ is your sequence value and $A,B,C,D$ are the unknown co-efficent,as there are infinite solution to this problem,i am assuming the given sequence's nth term is a polynomial,this is one possibe solution,as a matter of fact,you can assume $a_n=An^4+Bn^3+Cn^2+Dn$,this will be also correct with u getting another sequence with same first 4 terms, – TheDragonReborn Oct 22 '14 at 12:00
  • 1
    If there's a pattern to your numbers, I don't see them from just the four you've shown. Could you provide more values from the sequence? Five or ten more ought to do it. Also, your code mentions "day". Does this have something to do with days in a week? Please explain what you're trying to do. – Kevin Oct 22 '14 at 12:16
  • 2
    I immediately thought day, week, fortnight, month. – Neil W Oct 22 '14 at 13:07

2 Answers2

1

There are many possible formulas.

Using repeated differences we get $$ \begin{array}{llll} 1 & 7 & 14 & 30 & \\ 6 & 7 & 16 & \\ 1 & 9 & \\ 8 & \\ \end{array} $$ Assuming that the last difference repeats forever, Newton's interpolation formula then gives us $$ 1 \binom{n-1}{0} + 6 \binom{n-1}{1} + 1 \binom{n-1}{2} + 8 \binom{n-1}{3} $$ which simplifies to $$ \frac16 (8 n^3-45 n^2+115 n-72) $$

lhf
  • 216,483
0

There are infinite formulas. Try with interpolation.