Finding the number of two digit numbers

1.1k Views Asked by At

I was solving questions from a book and it had a question :

Find all two digit numbers such that the sum of digits constituting the number is not less than 7; the sum of squares of digits is not greater than 30; the number written in reverse order is not larger than half the numbers ".

I proceeded like this: Let the no be $10x+y$. So from the questions we have :

$$x+y \ge 7 \tag{1}$$ $$x^2 + y^2 \le 30\tag{2}$$ $$10y+x \le \frac{1}{2}(10x+y)\tag{3}$$

where $x \in [1,9]$ and $y\in[0,9]$. Now I am stuck up. How to proceed now?

4

There are 4 best solutions below

0
On

In $\mathbb R^2$, the first and third conditions define half planes, and the second one defines a disk. Draw these on gridded paper and you'll find the integer solutions in the intersection area.

Alternatively, try all two digit numbers by hand (using @almagest hint) or with a script.

for x in range(1, 9 + 1):
    for y in range(9 + 1):
        if x+y >= 7 and x*x+y*y <= 30 and 10*y+x <= (10*x+y)/2:
            print x, y

Output:

5 2
0
On

We have $$1\le x\le 9,\ \ 0\le y\le 9,\ \ x+y\ge 7,\ \ x^2+y^2\le 30,\ \ 10y+x\le\frac{10x+y}{2}\tag1$$

If we suppose that $x\ge 4\ \text{and}\ y\ge 4$, we have, from the fourth condition, $$32=4^2+4^2\le x^2+y^2\le 30,$$ which is a contradiction. Hence, we have $x\le 3\ \text{or}\ y\le 3$.

Now you can separate it into cases as

Case 1 : Check if there is $y$ which satisfies $(1)$ for each of $x=1,2,3$.

Case 2 : Check if there is $x$ which satisfies $(1)$ for each of $y=0,1,2,3$.

So, we have $7$ cases to check.

P.S. Another way which needs only $6$ cases to check.

If we suppose $y\ge 6$, we have, from the fourth condition, $$37=1^2+6^2\le x^2+y^2\le 30,$$ which is a contradiction. Hence, we have $y\le 5$.

So, you can check if there is $x$ which satisfies $(1)$ for each of $y=0,1,2,3,4,5$.

0
On

$$x+y\ge 7 \tag{1}$$ $$x^2+y^2 \le 30 \tag{2}$$ $$ 10y+x \le \frac{1}{2}(10x+y) \tag{3}$$ $$\implies 20y+2x \le 10x+y $$ $$\implies 19y-8x\le0$$ $$\implies x \ge \frac{19y}{8}$$ $$\implies x \ge 2.35 y$$

Obviously, $x$ cannot be a decimal number, so you need to ceil $x$ to the upper value.

So, possible values for $x$ and $y$ are: $(3,1),(5,2),(8,3)$

The only value that satisfy inequality $(1)$ and $(2)$ is $(5,2)$

0
On

$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ $$ 7^{2} \leq x^{2} + 2xy + y^{2}\leq 30 + 2xy\quad\imp\quad -2xy\leq -19 $$

$$ \pars{x - y}^{2} = x^{2} - 2xy + y^{2}\leq 30 + \pars{-19} = 11\quad\imp\quad -\root{11} \leq x - y \leq \root{11} $$

$$-3\leq x - y\leq 3$$

$$ \pars{~x + y \geq 7\quad\mbox{and}\quad x - y\geq -3~}\quad\imp\quad x \geq 2 $$ $$ \pars{~x + y \geq 7\quad\mbox{and}\quad y - x\geq -3~}\quad\imp\quad \color{#66f}{\Large y \geq 2} $$

Also, $\quad\ds{x \geq {19 \over 8}\,y\geq {19 \over 4}\quad\imp\quad \color{#66f}{\Large x\geq 5}.\quad}$

Also, $\ds{30 \geq x^{2} + y^{2}\geq 25 + y^{2}\ \imp\ \color{#66f}{\Large \verts{y} \leq \root{5}}}$ .Then $\color{#66f}{\Large \ds{y = 2}}$.

Similarly $\ds{30 \leq x^{2} + 2^2\quad\imp\quad \verts{x}\leq\root{26}\quad\imp \quad \color{#66f}{\Large x = 5}}$

There is just one solution: $\ds{\color{#c00000}{\LARGE 52}}$.