Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Is there any tool to get math sequence given the first few elements of the sequence.

I am trying to solve a few problems from projecteuler. I am looking for a math tool that can generate me a sequence formula.

Example given inputs like

5, 7, 9, 11, 13.....

The tool should detect its an arithmetic progression and give me following

a(n) = 5 + (n-1) 2 

A more complicated example would be from the link I provided above

1, 3, 5, 7, 9, 13, 17, 21, 25 .....
share|improve this question
    
Wouldn't it be better to figure out the pattern yourself, then use the pattern to come up with an equation? Exactly what kinds of sequences is it supposed to solve? Arithmetic? Geometric? Arithmetic-geometric? –  Mike Feb 3 '13 at 8:18
add comment

2 Answers

up vote 1 down vote accepted

Is the on-line encyclopedia of integer sequences good enough?

share|improve this answer
    
Thanks for this... –  ZEN.Kamath Feb 3 '13 at 8:30
add comment

A general strategy for determining patterns in sequences like the ones you show here is to analyze differences as follows. Consider your more complicated sequence:

$$1, 3, 5, 7, 9, 13, 17, 21, 25, \ldots$$

The first difference here is

$$2, 2, 2, 2, 4, 4, 4, 4, \ldots$$

So we see a constant difference, then a jump to another constant difference. You can see this even more clearly by taking the difference of the difference:

$$0, 0, 0, 2, 0, 0, 0, \ldots$$

A better example, though is a smooth one, like the squares of the integers:

$$1, 4, 9, 16, 25, 36, 49, 64 \ldots$$

The first difference is

$$3, 5, 7, 9, 11, 13, 15, \ldots$$

which you can see is a linear sequence. The second difference

$$2, 2, 2, 2, 2, 2, \ldots$$

is a constant sequence, which is characteristic of a sequence that increases quadratically. You can play around with all sorts of such sequences and see how their differences behave.

Taking further differences will not lead to a set of zeroes because of the isolated jump. So we can say that we have a discontinuity in the sequence away from which we have two linear subsequences.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.