Solve equations $x^2+x+1\equiv 0(\mod 7)$ and $2x-4\equiv 0(\mod 6)$

Solve equations $$x^2+x+1\equiv 0(\mod 7)$$ and $$2x-4\equiv 0(\mod 6)$$

I try from to find x using other equation since $$2x \equiv 4 (mod 6)$$ so $$x=6k+2$$ or $$x=6k+5$$, where $$k\in \mathbb N$$ if $$x=6k+2$$ then if we put this in first equation i get $$36k^2+30k+7$$ so if we want nature number then $$7|36k^2+30k$$ if I put $$k=7$$ then I get one solution $$x=44$$. If I think that $$k\not =7$$ then $$k=7m+l, l\in \{1,2,3,4,5,6,\}$$, $$m\in \mathbb N$$ then it show that $$7|36k^2+30k$$ if $$k=7m+5$$ so then $$x=6(7m+5)+2=42m+32$$ then if I put in other equation and first it is true that $$x=42m+32$$, so $$x\in \{74,116,...\}$$.

In second option that $$x=6k+5$$. And if I put in first equation I get $$36k^2+60k+25+6k+5+1=36k^2+66k+31$$ so this we can write as $$35k^2+k^2+63k+3k+28+3$$ so I need to show that $$7|k^2+3k+3$$ from here we can see that one solution $$k=1$$, then $$x=11$$ for $$k=2$$ this is not solution, for $$k=3$$ this is solution then $$x=23$$ if we want to find another number then we can write $$k=3r+1$$ or $$k=3r+2$$,$$r\in \mathbb N$$ it show that $$k\not =3r+1$$and $$k\not =3r+2$$.

So solution $$x\in \{11,23,42m+32\}$$, $$m\in \mathbb N$$.

Is this ok? Or you know some better way?

We can take $$x=3k+2$$. So $$(3k+2)^2+3k+2+1 \equiv 0 \mod 7$$ \begin{aligned} \begin{align} 9k^2+12k \equiv 0 \mod 7&\iff k(k+4)\equiv 0 \mod 7 \\ &\iff k=7m \ \ \text{or} \ \ k=7n-4 \end{align} \end{aligned} Hence, all solution set: $$\{21m+2,21n-10:m,n\in \Bbb Z\}$$

As $$(7,4)=1$$

$$x^2+x+1\equiv0\pmod7\iff(2x+1)^2\equiv-3\equiv4$$

$$\implies$$

either $$2x+1\equiv2\iff2x\equiv1\equiv8\iff x\equiv4\pmod7\ \ \ \ (1)$$

or $$2x+1\equiv-2\iff2x\equiv-3\equiv4\iff x\equiv2\pmod7\ \ \ \ (2)$$

and we have $$2x\equiv4\pmod6\iff x\equiv2\pmod3\ \ \ \ (3)$$

Apply CRT on $$(1),(3)$$

and $$(2,3)\implies$$lcm$$(3,7)\mid(x-2)$$

• can you write solution of CRT just to check did I get right solution? – Marko Škorić Nov 23 '18 at 8:41