3
$\begingroup$

I have recently been looking into a problem and created a function that looked interesting and I wondered if it would hit all odd numbers on a graph.

For integer $n$, define $$g_n(x) = \frac13\cdot \begin{cases} (3n-1) \cdot 2^{2x-1} - 1, & n \text{ even} \\[4pt] (3n-2) \cdot 2^{2x\phantom{-1}} - 1, & n \text{ odd} \end{cases} \tag{$\star$}$$

Is it true that, for any positive odd integer $k$, there are integers $n$ and $m$ such that $g_n(m)=k$?


PS: I think is easier to see as a graph: desmos graph


Note: The form of $(\star)$ is dramatically different than what appeared in the original version of this question. See answer by @Blue for the derivation, which matches coincident work by @automaticallyGenerated.

$\endgroup$
  • $\begingroup$ Your table is missing $3$ and $15$ $\endgroup$ – Naji Jul 23 at 21:15
  • $\begingroup$ Also, for $\mathbb{Z}$ just use \mathbb{Z} $\endgroup$ – Naji Jul 23 at 21:15
  • $\begingroup$ @Naji no, f(x) misses all multiples of 3, but I'm not talking about my table. and thank you for the symbol $\endgroup$ – spydragon Jul 23 at 21:16
  • 1
    $\begingroup$ @spydragon: I'll write $n$ for your $x_i$, and call your function $g_n(x)$. As a continuous exponential function, the graph of each $g_n(x)$ will hit every number (even, odd, transcendental, whatever) above its horizontal asymptote somewhere. Are you asking whether the $g_n(x)$ graphs will hit odd numbers at integer $x$ values? If so, then your question might be better stated thusly: For each odd integer $k$, are there integers $n$ and $m$ such that $g_n(m) = k$? $\endgroup$ – Blue Jul 23 at 21:43
  • 1
    $\begingroup$ @RoddyMacPhee Usually if unspecified, it's radians; they are standard in higher math. $\endgroup$ – Sambo Jul 23 at 22:36
2
$\begingroup$

It can be seen that $f_n = 3n+\frac{cos(\pi n)-3}{2}$. $\frac{cos(\pi n)-3}{2}$ will be equal to $-2$ if $n$ is odd and $-1$ if $n$ is even. Thus, $f_n = 3n-( n\pmod 2)-1$.

From that, we get $$g_n(x) = \frac{(3n-( n\pmod 2)-1)*2^{2x+1-(((3n-( n\pmod 2)-1) \space \text{mod} \space 3))}-1}{3}$$

Simplifying this finds $$g_n(x) = \frac{(3n-( n\pmod 2)-1)*2^{2x+1-(((-( n\pmod 2)-1) \space \text{mod} \space 3))}-1}{3}$$

Simplifying this further finds $$g_n(x) = \frac{(3n-( n\pmod 2)-1)*2^{2x+n\pmod 2 -1}-1}{3}$$

Let's say that $n = 2k$, with $k$ an integer. Then, $$g_n(x) = \frac{(6k-1)*2^{2x-1}-1}{3}$$

If we fix $x = 1$, we get all values $y$, such that $y = 3 \pmod 4$

Similarly, if we fix $x = 2$, we get all values $y$, such that $y = 13 \pmod {16}$.

If we fix $x = 3$, all values such that $y = 53 \pmod {64}$. In general, if we fix $x$ as a positive integer, we get all values such that $y = \frac{5*4^{x}-2}{6} \pmod {4^x}$

So far, we have proved that the odd integers of the form $y = $: $$3 \pmod {4}$$ $$13 \pmod {16}$$ $$53 \pmod{64}$$ etc exist.

Covering the other case, where $n = 2k+1$, we get $$g_n(x) = \frac{(6k+1)*2^{2x}-1}{3}$$ If we similarly fix $x$ as a positive integer, we get values $y$ such that $y = \frac{4^x-1}{3} \pmod {2^{2x+1}}$

This yields $y$ such that $y = $: $$1 \pmod {8}$$ $$5 \pmod {32}$$ $$21 \pmod {128}$$

etc exist.

Both of these sets cover all positive odd integers. The reason for this is that $3 \pmod 4$ covers all odd values except for $y = 1 \pmod 4$. $1 \pmod 8$ then covers all values that are not already covered except for $y = 5 \pmod 8$. Then $13 \pmod {16}$ covers everything except for $5 \pmod {16}$. This process can be extended ad infinitum until all odd positive integers are "covered".

Therefore, this function does cover all positive odd integers when $n, m$ are integers.

$\endgroup$
  • $\begingroup$ this looks right, and if it is you might have solved the Collatz conjecture $\endgroup$ – spydragon Jul 24 at 0:11
  • $\begingroup$ I don't know about that, but how is this connected to the Collatz conjecture? $\endgroup$ – automaticallyGenerated Jul 24 at 0:52
  • $\begingroup$ connecting one to all other numbers is the main strategy, but since every even number is guaranteed to become odd, you can ignore them all that's left is connecting all the odd numbers in a certain way which I encoded into my equations and you connected them all together $\endgroup$ – spydragon Jul 24 at 0:57
  • $\begingroup$ $6n-3=3(2n-1)$ think rhis how m moves during a $3m+\over 2$step of Collatz I might be wrong. $\endgroup$ – Roddy MacPhee Jul 24 at 13:38
  • $\begingroup$ there is an error, in your last equation $y = \frac{4^x-1}{3} \pmod {2^{x+1}}$ shouldn't it be $y = \frac{4^x-1}{3} \pmod {2^{2x+1}}$? $\endgroup$ – spydragon Jul 26 at 6:06
3
$\begingroup$

Too long for a comment.


We can re-write a bit:

$$\begin{align} f_n &= \tfrac12 (6n-3+\cos(\pi n)) \\ &= \tfrac12 (6n-3+(-1)^n) & \text{(since $n$ is an integer)}\\ &= \tfrac12 (6n -4 + 1 +(-1)^n) \\ &= 3n-2+\color{red}{\tfrac12\left(1+(-1)^n\right)} \\ &= 3n-2+ \color{red}{\left( 1 - (n \bmod 2) \right)} & \text{(getting clever)} \\ &= 3n-3+ 2 - (n \bmod 2) \\ &= 3(n-1)+ 2 - (n \bmod 2) \\ \end{align}$$ The last steps are to prepare for this: $$f_n \bmod 3 = 2 - (n\bmod 2)$$ Now, the $g_n$ function becomes:

$$g_n(x) = \tfrac13 \left(f_n \cdot 2^{2x-1+ (n\bmod 2)} - 1 \right)$$

At this point, having to refer back to $f_n$ is a bother, but inserting the expression for $f_n$ is cumbersome. Since there's only even/odd-ness to consider, the best option might be just to write-out the cases explicitly:

$$g_n(x) = \frac13\cdot \begin{cases} (3n-1) \cdot 2^{2x-1} - 1, & n \text{ even} \\[4pt] (3n-2) \cdot 2^{2x\phantom{-1}} - 1, & n \text{ odd} \end{cases}$$

This makes the $g_n$ function completely self-contained and easier to analyze.

$\endgroup$
  • $\begingroup$ you should put it in your rephrasing of my post, then delete this because its not a real answer, good job on simplifying it. $\endgroup$ – spydragon Jul 23 at 23:33
  • $\begingroup$ @spydragon: I want to let this sit a while, and then come back to it fresh and double/triple check that I didn't mess up a sign or something. (You could/should verify yourself that it's equivalent to your version.) If/when we're reasonably convinced it's okay, I'll paste my final $g_n(x)$ into your post. In any case, I'll leave this answer available for additional public scrutiny. ("Too long for a comment"-type (non-)answers are acceptable, by the way.) $\endgroup$ – Blue Jul 23 at 23:58
  • $\begingroup$ oh ok, I'll check it looks right though $\endgroup$ – spydragon Jul 24 at 0:00
  • $\begingroup$ @spydragon: I like to think so. :) That said, since it would be replacing your formulation, it's extra-important to ensure that I haven't changed the nature of your problem. $\endgroup$ – Blue Jul 24 at 0:01
  • $\begingroup$ well you encoded the if odd then the exponent must be odd rule (same with even) the only thing I think I actually have to check is the first part $(3n-1)$ or $(3n-2)$ though, as I said. it looks right $\endgroup$ – spydragon Jul 24 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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