2

I have a system as follows

$$6 + 4n = x,\quad 8 + 3m = x.$$

now I know I can get to the point where:

$$n = (2 + 3m)/4,$$

and I can parametrize $m$ as $z$ to get all possible values in $R$.

What I want to do instead is to lock down $n$ and $m$ to be integer numbers instead of real numbers. And I'd like to get the very first number if that exist.

In the example above $m = 1$ wouldn't work since $n$ would be $1.25$. However $m = 2$ would do the trick and would lead to $n = 2$.

I wonder, how do I set in the system this constraint?

Edit: I guess one idea there could be to round up to the next integer by doing something like

$$m = 1,\quad n = (2 + 3 * 1 + 4 - 1)/4.$$

Would that be correct?

  • Do you know about modular arithmetic? – Robert Israel Sep 26 '21 at 15:50
  • not sure :) can you expand? – Andrea Giuliano Sep 26 '21 at 15:51
  • If $m$ is an integer, for $(2+3m)/4$ to be an integer you want $2+3m \equiv 0 \mod 4$, which is equivalent to $m \equiv 2 \mod 4$. – Robert Israel Sep 26 '21 at 19:29
  • Hi, thanks.. wouldn't this be (2 + 3m) mod 4 = 0 ? Also how did you get from 1st to 2nd step? – Andrea Giuliano Sep 27 '21 at 08:47
  • $\mod 4$ is something that applies to the whole equation, not just one side of it: $a \equiv b \mod c$ means $a-b$ is a multiple of $c$. – Robert Israel Sep 27 '21 at 13:38
  • Starting from $2 + 3 m \equiv 0 \mod 4$, you subtract $2$ from both sides, then multiply by $3$ which is its own multiplicative inverse mod $4$. – Robert Israel Sep 27 '21 at 13:42
  • so just to understand this step by step, I figured I've asked the same question to @poetasis below. Can you correct the following steps by steps (I think they are wrong) $$2 + 3m = 0 mod 4$$ $$3m = -2 mod 4$$ $$m = -2/3 mod 4$$ what do i do now (I suppose there is a mistake from step 2 tbh :( ) – Andrea Giuliano Sep 27 '21 at 15:33
  • I think I see what you've done there..correct me if I'm wrong: once you have $3m = -2 (mod 4)$ then you multipy by 3 as you say and you would get $9m = -6$ but since the equation is locked to mod 4 then you do $9 mod 4 = 1$ and $-6 mod 4 = 2$ is that correct? I wasn't aware that you can just move down all the numbers in the equation to mod 4 independently like in this way.. – Andrea Giuliano Sep 27 '21 at 16:57

1 Answers1

1

\begin{align*} 8 + 3m = x\\ 6 + 4n = x\\ 2+3m-4n=0\\ m=\dfrac{2(2n-1)}{3}\implies n=3k-1 \end{align*}

From this we can easily see when all three valiables are integers, i.e. when $2n-1$ is a multiple of $3$.

$$m,n,x\in\mathbb{N}\quad\iff \quad n\in\big\{2,5,8,\cdots ,(3k-1)\big\}, \space k\in\mathbb{N} $$

poetasis
  • 6,338
  • thanks.. yes I can "visually" see "when all three valiables are integers" but I wonder what is the formula that for instance will lead to the first integer number in the sequence. In the example, when n = 2 for instance – Andrea Giuliano Sep 27 '21 at 08:30
  • @Andrea Giuliano The fist number is $n=3k-1=3(1)-1=2.\quad$ Then $m=\dfrac{2\big(2(n)-1\big)}{3}=\dfrac{2\big(2(2)-1\big)}{3}=\dfrac{2(3)}{3}=2.\quad $ Then $x\quad=8 + 3m=8+3(2)=14\quad= 6+4n=6+4(2)=14.\qquad$ Just remember $k\in{1,2,3,4,5,....}$ – poetasis Sep 27 '21 at 09:47
  • thanks @poetasis. I was trying to do the same with another equation to check what I'm still missing here.. suppose we have $$1 + n = x\quad 5 + 2m = x$$

    that leads us to $$n = 4 + 2m$$ if we substitute m to k where $$k = 1, 2, 3, ...$$ that gives us $$n = 6.$$

    However I was expecting n to be 5 since 1 + n for n = 0, 1, 2, 3, 4 is the series 1, 2, 3, 4, 5, ... And 5 + 2m where m = 0, 1, 2, 3 is the series 5, 7, 9, .. so the first number they intersect is actually 5.. What am I missing here?

    – Andrea Giuliano Sep 27 '21 at 10:12
  • also, Followup question: how did you infer that $$n = 3k -1$$ ? – Andrea Giuliano Sep 27 '21 at 10:18
  • @Andrea Giuliano only when $n=3k-1$ can $2n-1$ be a multiple of $3$. so $n\in{2,5,8,11,\cdots.\quad$ This makes $\dfrac{2n-1}{3}\in\mathbb{N}$ and $m\in{2,4,6,8\cdots}$ and you can figure out $x$. – poetasis Sep 27 '21 at 13:39
  • thanks @poetasis! yeah I get how we get from $$n = 3k - 1$$ to the rest but I was wondering how do we go from: $$(2n -1) mod 3 = 0$$ to $$n = 3k -1$$ ? – Andrea Giuliano Sep 27 '21 at 14:10
  • @Andrea Giuliano It is not $3k-1 mod 3=0\quad$ What we have is $\big(2(3k-1)-1\big)\equiv 0 \pmod 3$ – poetasis Sep 27 '21 at 14:15
  • ok, I'm sure I'm missing something :) sorry for being dumb but not sure how are we getting the $$n = 3k -1$$ from the initial equations? – Andrea Giuliano Sep 27 '21 at 14:19
  • @Andrea Giuliano From the original equations we know $\quad m=\dfrac{2(2n-1)}{3}\quad $ and we can see that $\quad (2n-1)\quad$ must be a multiple of $3.\quad$ This means $\quad n=3k-1\quad$ and $\quad m=\dfrac{2\big(2(3k-1)-1\big)}{3}$ – poetasis Sep 27 '21 at 14:27
  • thank you! so the part I'm struggling with is this:

    we can see that $$(2−1)$$ must be a multiple of 3. This means $$=3−1$$

    How did we get from "expression must be multiple of 3" to $$=3−1$$?

    – Andrea Giuliano Sep 27 '21 at 14:34
  • @Andrea Giuliano How else do you get $2n-1$ being a multiple of $3?$ What numbers do you plug in for $n?$ Play with it on paper and you might see. – poetasis Sep 27 '21 at 15:24
  • sorry I've tried but unsuccessfully... if you have to express $2n-1$ being a multiple of 3 in a math equation, and then derive to the $3k -1$ would you mind to show how would you do it step by step? – Andrea Giuliano Sep 27 '21 at 15:55
  • here's what I tried.. to impose 2n-1 is a multiple of 3 I can have the following equation: $$2n - 1 = 3k mod 3$$ form this I can go here $$n = (3k + 1)/2 mod 3$$

    from this point I get stuck and I don't really know how to go to $$n = 3k -1$$

    – Andrea Giuliano Sep 27 '21 at 16:03
  • @Andrea Giuliano Somehow you need to generate $n\in\big{2,5,8,11,\cdots\big}.\quad $ This happens with $n=3k-1$ – poetasis Sep 27 '21 at 16:18
  • alright, let me try in a different way... say you have the following $$an + b$$ and you want to add in your system that such is divisible by c. How would you get n and k? – Andrea Giuliano Sep 27 '21 at 16:37
  • 1
    @Andrea Giuliano I am done with my attempts to help. Good luck – poetasis Sep 27 '21 at 16:50