#### laurencewithau

##### New member

- Joined
- Mar 25, 2019

- Messages
- 15

- Thread starter laurencewithau
- Start date

- Joined
- Mar 25, 2019

- Messages
- 15

- Joined
- Nov 12, 2017

- Messages
- 4,444

You should be aware of "piecewise-defined functions", which are defined by stating the value of the function in two or more cases. That is a perfectly valid way to state a formula, and it makes the nature of the function or sequence clear.

But one common way to do what you are asking for is to make use of sequences like 1, 0, 1, 0, ..., which can be expressed as "n mod 2" if the mod function is available (as in Excel), or constructed from other functions, like (1 - (-1)^n)/2. Try that out, and see if you can find a formula for your example.

- Joined
- Jan 29, 2005

- Messages
- 8,442

Try this \(\displaystyle a(n)=2n\left( {\left\lfloor {\frac{n}{2}} \right\rfloor - \left\lfloor {\frac{{n - 1}}{2}} \right\rfloor } \right) + n\left( {\left\lfloor {\frac{{n + 1}}{2}} \right\rfloor - \left\lfloor {\frac{n}{2}} \right\rfloor } \right)\)Hi, I used to be a maths teacher but that was years ago and I'm rusty. My question concerns sequences and series. If two simple integer sequences, each with its own nth term formula, are combined, in what conditions can the resulting sequence have its own nth term formula? Here's my example: 1, 4, 3, 8, 5, 12, .... This combines odd numbers and double numbers, the formulas being 2n - 1 and 2n. I've tried and failed to find an nth term formula.

SEE HERE

- Joined
- Mar 25, 2019

- Messages
- 15

Hi Dr Peterson

You should be aware of "piecewise-defined functions", which are defined by stating the value of the function in two or more cases. That is a perfectly valid way to state a formula, and it makes the nature of the function or sequence clear.

But one common way to do what you are asking for is to make use of sequences like 1, 0, 1, 0, ..., which can be expressed as "n mod 2" if the mod function is available (as in Excel), or constructed from other functions, like (1 - (-1)^n)/2. Try that out, and see if you can find a formula for your example.

Thanks for your reply. That's way over my head, my maths being A level at best; but it does answer my question, for what I had in mind was whether there was, if you like, an A level formula, involving just the basic operations over integers, fractions, integer powers or roots, as with geometric, arithmetic or power series, but not involving different cases with separate functions or anything like that.

So the answer, in other words, is no, it's not possible. Thanks again.

- Joined
- Nov 12, 2017

- Messages
- 4,444

There are many ways to do this; all of them will look ugly, especially if you try to "simplify" (e.g. combining like terms), which hides what is happening.

In piecewise form, the combined sequence is

\(\displaystyle a_n = \left\{\begin{matrix}n & \text{for odd }n\\ 2n & \text{for even }n\end{matrix}\right.\)

To my mind, that is the simplest and clearest way to write it.

- Joined
- Mar 25, 2019

- Messages
- 15

Hi pka,Try this \(\displaystyle a(n)=2n\left( {\left\lfloor {\frac{n}{2}} \right\rfloor - \left\lfloor {\frac{{n - 1}}{2}} \right\rfloor } \right) + n\left( {\left\lfloor {\frac{{n + 1}}{2}} \right\rfloor - \left\lfloor {\frac{n}{2}} \right\rfloor } \right)\)

SEE HERE

Thanks for your reply. As I said to Dr Peterson, it's too advanced for me, but it does answer my question, which was really about whether there is a single formula in 'n' that picks up on each term of the sequence, and clearly there's not. Thanks again.

- Joined
- Mar 25, 2019

- Messages
- 15

Hi Dr Peterson. Now I have a better idea of what you mean by a valid formula not needing to be exactly the same operation on each integer value, and yes, it's really neat, and I like the way that you've just used 'n' and '2n', the '2n-1' dropping out altogether. One does wonder, though, whether two simple sequences can ever be combined in that way to yield a sequence with its own simple nth term formula. But also, similar but different, what if you have a simple sequence, say a simple linear sequence governed by a simple rule, say 'add 2', in other words an arithmetical progression, except that after a given number of terms, the rule changes, and then again, and so on. Simplest example: 1, 2, 3, 5, 7, 10, 13, 17, 21, ... The rule is 'add 1 twice, add 2 twice, add 3 twice, and so on. Again, I do not know whether a simple nth term single function formula is possible, but I would guess not. Thanks again.

There are many ways to do this; all of them will look ugly, especially if you try to "simplify" (e.g. combining like terms), which hides what is happening.

In piecewise form, the combined sequence is

\(\displaystyle a_n = \left\{\begin{matrix}n & \text{for odd }n\\ 2n & \text{for even }n\end{matrix}\right.\)

To my mind, that is the simplest and clearest way to write it.

\(\displaystyle f(n) = \sum_{k=1}^n u(k) \text { and}\)

\(\displaystyle g(n) = \sum_{k=1}^n v(k) \implies\)

\(\displaystyle h(n) = f(n) + g(n) = \sum_{k=1}^n \{u(k) + v(k)\}.\)

Is that what you were asking?

- Joined
- Jan 29, 2005

- Messages
- 8,442

Jeff, laurencewithau ask if it were possible to find a definite formula for the general term of the sequence:Perhaps I do not understand the problem. Is that what you were asking?

\(\displaystyle 1,~4,~3,~16,~5,~36,\cdots\) that is \(\displaystyle a_n=\begin{cases}n &: n\text{ is odd} \\ n^{2} &: n\text{ is even}\end{cases}\)

But that is not a single term definition. THIS IS.

- Joined
- Nov 12, 2017

- Messages
- 4,444

It's hard to define "simple rule"; and even harder to prove that something vaguely defined can't be done. CertainlyHi Dr Peterson. Now I have a better idea of what you mean by a valid formula not needing to be exactly the same operation on each integer value, and yes, it's really neat, and I like the way that you've just used 'n' and '2n', the '2n-1' dropping out altogether. One does wonder, though, whether two simple sequences can ever be combined in that way to yield a sequence with its own simple nth term formula. But also, similar but different, what if you have a simple sequence, say a simple linear sequence governed by a simple rule, say 'add 2', in other words an arithmetical progression, except that after a given number of terms, the rule changes, and then again, and so on. Simplest example: 1, 2, 3, 5, 7, 10, 13, 17, 21, ... The rule is 'add 1 twice, add 2 twice, add 3 twice, and so on. Again, I do not know whether a simple nth term single function formula is possible, but I would guess not. Thanks again.

Similarly, though, many problems are most naturally and usefully expressed not in terms of a formula at all, but an algorithm, like a computer program. (A piecewise definition is in effect a very simple conditional program.) Restricting a problem to single formulas is unnecessary (though I admit it can be fun to find one).

Wow, I am glad that you were able to parse that question. I did not pay enough attention to the word "example." Or I would have seen that the example did not fit what purported to be the definition of the problem. And then the OP did not understand that you gave him the exact kind of answer that he wanted.Jeff, laurencewithau ask if it were possible to find a definite formula for the general term of the sequence:

\(\displaystyle 1,~4,~3,~16,~5,~36,\cdots\) that is \(\displaystyle a_n=\begin{cases}n &: n\text{ is odd} \\ n^{2} &: n\text{ is even}\end{cases}\)

But that is not a single term definition. THIS IS.

Or I would have seen that the example did not fit what purported....

[per-

reputed or claimed; alleged:

We saw no evidence of his purported wealth.

- Joined
- Mar 25, 2019

- Messages
- 15

Hi jeffM. No, but I wish I knew how to phrase it clearly and correctly. My question is about two linear sequences in 'n', such that when they are combined into one sequence, its nth term formula is a simple formula in 'n', by which I mean a formula of the type found in A level sequences and series, so that it is a single expression in 'n' that yields all the terms of the sequence when 'n' is replaced by the successive integer values. That expression need not be linear; it could be quadratic, cubic, whatever, but nothing that requires advanced maths or number theory, so no modulus this or that, no floor function, whatever that might be. For instance, the formula for the nth term of a Fibonacci sequence is complicated but any A level maths student will understand it, because it involves no new mathematical concepts and is basically similar to a geometrical sequence or series, which he will be familiar with. Thanks again.

\(\displaystyle f(n) = \sum_{k=1}^n u(k) \text { and}\)

\(\displaystyle g(n) = \sum_{k=1}^n v(k) \implies\)

\(\displaystyle h(n) = f(n) + g(n) = \sum_{k=1}^n \{u(k) + v(k)\}.\)

Is that what you were asking?

- Joined
- Mar 25, 2019

- Messages
- 15

Hi Dr Peterson. I like your example, and what it shows is that sometimes what I said can't be done can very easily be done, and in such a way as to suggest a method: instead of taking two sequences, take one and look for ways to split it. Thanks again.It's hard to define "simple rule"; and even harder to prove that something vaguely defined can't be done. Certainlysomesequences are similar enough that they combine to make a simple formula (consider 1, 3, 5, ... and 2, 4, 6, ..., for a trivial example!). Butinterestingsequences probably would at the least require the ideas we've suggested (mod, floor, powers of -1, periodic functions like sine, etc.). For cases where the rule increments every k terms, I think the floor function would be very helpful, and without it I wouldn't expect much. Some special cases might be possible to do with only elementary arithmetic operations; I'm just not interested in trying.

Similarly, though, many problems are most naturally and usefully expressed not in terms of a formula at all, but an algorithm, like a computer program. (A piecewise definition is in effect a very simple conditional program.) Restricting a problem to single formulas is unnecessary (though I admit it can be fun to find one).

- Joined
- Mar 25, 2019

- Messages
- 15

Hi Denis. Are you sure? Don't forget that 'purport' is a verb, with 'purported' as past tense. Cheers.purported

[per-pawr-tid, -pohr-]

adjective

reputed or claimed; alleged:

We saw no evidence of his purported wealth.

- Joined
- Feb 4, 2004

- Messages
- 15,946

purported

[per-pawr-tid, -pohr-]

adjective

reputed or claimed; alleged:

We saw no evidence of his purported wealth.

Or, as demonstrated in the dictionary snippet provided, "purported" can be an "adjective", being the modifier of a "noun" and expressing a quality of that noun -- in this case, the fact that the noun, usually being a claim or a statement, has been alleged but does not seem to have been proven or is viewed with some suspicion.Hi Denis. Are you sure? Don't forget that 'purport' is a verb, with 'purported' as past tense.

- Joined
- Mar 25, 2019

- Messages
- 15

Oops! I'm holding my breath, hoping that no-one will query your use of 'snippet'.Or, as demonstrated in the dictionary snippet provided, "purported" can be an "adjective", being the modifier of a "noun" and expressing a quality of that noun -- in this case, the fact that the noun, usually being a claim or a statement, has been alleged but does not seem to have been proven or is viewed with some suspicion.