0

how can I find the next number in this sequence ,

1, 4, 7, 8, 13, 12, 9 , ?

How to check , given any sequence of numbers , feasible or not. Any general theory or approach is very much welcomed .

Lawliet
  • 77
  • 6

2 Answers2

0

One method is to go to the Online Encyclopedia of Integer Sequences and enter your list of at least six or eight numbers into the box and see if that happens to be a known sequence. For your example this doesn't find a known sequence.

If that doesn't work then you can try Mathematica's FindFormula

p=FindFormula[{1, 4, 7, 8, 13, 12, 9}];

and then

p[1] returns 1, p[2] returns 4, p[3] returns 7... and p[8] returns 106, etc.

You can read the documentation on FindFormula and you can look at the formula p by using InputForm[p] where #1 represents a variable in the function p.

In general I think this is rarely going to produce the result that you are looking for.

Bill
  • 3,664
  • 1
  • 12
  • 9
  • But the Question paper in which I have seen this question saying the answer is 16. So how can I make sure that the question is error proof. – Lawliet Jun 11 '20 at 17:37
0
seq = FindSequenceFunction[{1, 4, 7, 8, 13, 12, 9}, n]

(48 - 74 n - 14 n^2 + 11 n^3 - n^4)/(3 (-13 + 3 n))

Checking the 7th number

n = 7;
seq

9

The next number is a fraction, apparently

n = 8;
seq

32/11

Show[Plot[seq, {n, 1, 10}],
 ListPlot[Table[seq, {n, 1, 10}]],
 PlotRange -> {{0, 10}, {-20, 30}}, AxesOrigin -> {0, 0}]

enter image description here

Chris Degnen
  • 8,443
  • 2
  • 23
  • 40