0
$\begingroup$

I've been trying to find the n-th term for this sequence for a little while now, and I just keep coming up short.

$$S=1,0,1,0,0,1,0,0,0,1,0,0,0,0,1,...$$ All I can see is that every triangular ordinal is $1$, if not, then it must be $0$ I feel like this shouldn't be too too hard, but maybe I'm wrong? Any thoughts?

  • 1
    You seem to be correct. This is the indicator function for the triangular numbers as a subset of the natural numbers. Hence the function will be $f(n) = 1$ if $\exists k \in \mathbb N, n = \frac{k(k+1)}{2}$, and $0$ otherwise.2017-02-22

1 Answers 1

1

Yes, you are right. We can write our function as: $$f (n) = \begin {cases} 1 \, \, \text { if } n = \frac {k (k+1)}{2} \,\,; k \in \mathbb N\\ 0 \,\, \text { otherwise }\end {cases} $$

Hope it helps.

  • 0
    Yeah, I see that. I guess I was trying to find another way to write it as opposed to defining a new function. For the sequence $$S= 1,0,1,0,1,0...$$ I had written $$\lceil {\frac{(-1)^{n+1}}{2}} \rceil$$2017-02-22
  • 0
    Even though that may be overkill. Is there anyway to write the previous in terms of known functions?2017-02-22
  • 0
    @RyanGoulden There are lots of ways. I'd probably go with the Indicator function.2017-02-22
  • 0
    Okay, I think I understand. But what happens if I made all of those zeros 1, and then all of the $1$'s be the next natural. $$S=1,1,2,1,1,3,1,1,1,4,1,1,1,1,5...$$ You would have that it is always zero when it's not in the form of a triangular number, but how do you denote the changes?2017-02-22
  • 0
    @RyanGoulden In that case, we have $$f (n) = \begin {cases} k\,\, \text {if}\,\,n= \frac {k (k+1)}{2}\,\,;k \in \mathbb N\\ 1\,\, \text {otherwise}\end {cases} $$2017-02-22