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.

I have a sequence of numbers below...

$1, 2, 4, 7, 11, 16 ...$

You get this list by starting at $1$ then add $1, 2, 3, 4, 5 ...$

Given a number $n$, how can I determine if it will show up in this pattern of numbers?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The $k$th term in your sequence is $1+\frac{k(k-1)}{2}$. [See triangular numbers.] Given your number $n$, you just need to check if it is of this form or not.

share|improve this answer
    
Just to note (not necessarily for angryavian): the true triangular numbers start at $0$. Thus, this is more of a triangular sequence rather than the triangular numbers. Same idea of course, as mentioned above. –  Vincent Aug 19 at 2:57
    
I have no idea how you got that but it works like a charm –  Ogen Aug 19 at 7:49

Put another way, take your number, multiply by $8,$ then subtract $7.$ If the result is a perfect square, the number is in the sequence, otherwise no.

share|improve this answer
    
Analogous to that, for just $\frac{n^2+n}{2}$ you can multiply by $8$ and add $1$. If that result is a perfect square, it is in the sequence. –  Vincent Aug 19 at 3:12
    
@Vincent, the given sequence is shifted by a constant, it would be $(n^2 +n+2)/2$ –  Will Jagy Aug 19 at 3:15
    
Yes. I was using your same technique but applied it to the triangular numbers. I thought since this question is very closely related to the triangular numbers is was worth mentioning the application of your method to them. –  Vincent Aug 19 at 3:22
    
@Vincent, I see. –  Will Jagy Aug 19 at 3:23
1  
@Vincent To describe what you have observed, $$8 \frac{n(n+1)}{2}+1=4n^2+4n+1=(2n+1)^2.$$ –  angryavian Aug 19 at 3:53

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.