I need a set-builder notation for $\{1 , 3 , 5 , -7 , -9 , -11 , 13 , 15 , 17 , \ldots\}$. It is an infinite set of odd positive integers, which are multiplied by $-1$ three by three. One of the terms of this question is not to use floor function.
-
Can you do a notation for $1,1,1,-1,-1,-1,1,1,1,-1,-1,-1,\ldots$ (as a sequence?) – Henno Brandsma Jul 02 '16 at 05:44
-
1That is the main part of question . No , i can't – Jul 02 '16 at 05:48
-
can you use modular arithmetic? – Aweygan Jul 02 '16 at 05:50
-
Are you allowed to use trigonometric functions? – JimmyK4542 Jul 02 '16 at 05:51
-
None of these two , no trigonometric function and modular arithmetic – Jul 02 '16 at 05:57
-
So what are you allowed to use? – JimmyK4542 Jul 02 '16 at 06:00
-
-1 to powers , division, multipilication etc . Sorry but this is what my book's writer has asked – Jul 02 '16 at 06:05
-
I've deleted my answer as based on wolframalpha, the recurrence solution involved trigonometric functions, which is disallowed. Unless one wants to cheat with Euler's formula somehow. – Mike Jul 02 '16 at 06:35
-
@GLASSIC your question is the same as asked above also it contains all your conditions. – Taha Akbari Jul 04 '16 at 09:45
-
@GLASSIC was my solution helpful.It's better to take a photoe and share your problem with photes. – Taha Akbari Jul 04 '16 at 14:17
-
I can't put comments on code golfa give me a way to cominiucate with you about the bounty I offered – Taha Akbari Jul 12 '16 at 11:57
7 Answers
Well, no doubt you are hoping for something cleverer than this, but:
$$ \{\,a\mid\exists k\in \mathbb {N}_{0}:(\exists m \in \{1,3,5\} :a = m+12k)\vee (\exists m \in \{-7,-9,-11\} :a = m-12k)\,\}$$
which I suddenly realized is actually
$$ \{\,a\mid\exists k\in \mathbb {Z}:(\exists m \in \{1,3,5\} :a = m+12k)\,\}$$
- 39,627
With the convention $0 \in \mathbb{N}$, you can also write this:
$$(\{1,3,5\}+12\mathbb{N}) \cup (\{-7,-9,-11\}+(-12)\mathbb{N})$$
- 67,744
Define $f:\mathbb{N} \to \mathbb{Z}$ as follows. $f(1) = 1$, $f(2) = 3$ $f(3) = 5$ and $$f(n) = -\text{sgn}(f(n-3))\cdot(2n-1)$$
for $n \geq 4$
Then this set is $\{c \in \mathbb{Z}: \exists n \in \mathbb{N} \ \text{such that} \ f(n) = c\}$. That is, the set is the image of the function.
- 12,462
$$\left\{(-1)^{\lfloor n/3\rfloor}(2n+1)\mid n\in\mathbb N\right\}$$
Or, if you are using a finicky notion of set-builder notation:
$$\left\{x\in\mathbb Z\mid \exists n\in\mathbb N\left[x=(-1)^{\lfloor n/3\rfloor}(2n+1)\right]\right\}$$
- 177,126
For $n\in\mathbb{N}$, $\cos(n\pi/3)$ is never $0$. It oscillates from being positive for three consecutive terms, then negative for three. Using this, one way to express your sequence is $$a_n=\frac{\cos\left(\frac{(n-2)\pi}{3}\right)}{\left\lvert\cos\left(\frac{(n-2)\pi}{3}\right)\right\rvert}(2n-1)$$ As a set in set-builder notation, you have $$\left\{\frac{\cos\left(\frac{(n-2)\pi}{3}\right)}{\left\lvert\cos\left(\frac{(n-2)\pi}{3}\right)\right\rvert}(2n-1)\middle| n\in\mathbb{N}\right\}$$
Of course there is nothing more fundamental about the absolute value function than the signum function, so another way to express this is:$$\left\{\operatorname{sign}\left(\cos\left(\frac{(n-2)\pi}{3}\right)\right)(2n-1)\middle| n\in\mathbb{N}\right\}$$
- 54,717
If you are allowed to use square roots, then something like: $$\left\{(2n+1) \cdot(-1)^{\tfrac{1}{\sqrt{5}} \left(\left(\tfrac{1+\sqrt{5}}{2}\right)^{n-1} - \left(\tfrac{1-\sqrt{5}}{2}\right)^{n-1}\right) - (n-1)} \big| n \in \mathbb{N}\right\}$$ will work. (Here, we use the convention that $0 \in \mathbb{N}$.)
This answer has the advantage that it doesn't use the floor/ceiling functions, modular arithmetic, or trigonometric functions (as OP requested), but the downside is that it's complicated.
- 54,331
-
In the Islamic republic of Iran where the asker began $0$ is not a natural number but we have another set $w$ that contains $0$ and all natural numbers.It would better to write $n\in w$ it would be more helpful to the asker who is from Islamic republic of Iran. – Taha Akbari Jul 04 '16 at 14:20
-
@JimmyK4542 can you add a description please ? i computed this using some high precision softwares and it is correct . – Jul 08 '16 at 12:51
-
1
$a_n=\operatorname{sgn}(\Im(e^{(2n+1)i\pi/12})$ where $sgn$ is the Signum function
and$\Im$ is the imaginary part of a complex number.
- 3,559