Number equal to the sum of digits + product of digits)

1.1k Views Asked by At

Are every number equal to (sum of digits + product of digits) in a given base only two digits long ? Thought about limiting like this :

$$b^{(n - 1)} \leq N = \text{Product digits} + \text{Sum digits} \leq (b - 1)*n + (b - 1)^{(n)}$$

Obviously the set is finite (when $n \rightarrow +\infty$) but can't figure out how to get more precision about the set

Any idea ?

ie in base 10 : {0,19,29,39,49....,99}

Edit : 'base' abreviation : b. Number of digits for a number N : n

3

There are 3 best solutions below

2
On

The product of a number's digits is always less than the number unless the number only has one digit. This is because all numbers can be represented by $a_0+a_1b^1+a_2b^2+...a_nb^n$ where $a_n<b$. Taking the first digit, $a_nb^n$, we can see that $a_0a_1a_2...a_n<a_nb^n$ because all digits are less than the base. In fact, the difference between the product of all the digits and the value of $a_nb^n$ is always greater than $b^{n-1}$, which you get for numbers like $100$ or $1000_4$. You can see this by realizing that decreasing the $m^{th}$ digit by $1$ decreases the number by $b^n$ but only decreases the product by $a_0a_1a_2...a_{m-1}a_{m+1}...a_n$. This process leads you to start with $b^n-1$ and decrease the first digit by $1$ (since $b^n>(b-1)^n$) until the first digit is $1$. Then, you can decrease the second digit by one (since $b^{n-1}>(b-1)^n$) until the second digit is zero. Then, the product of the digits will be zero no matter what you do, so you can make all the digits but the first digit zero. The upper bound on a number's digital sum is just $n(b-1)$, but we'll use the upper bound $nb$. Finally, combining the lower bound for what the digital sum needs to be with the upper bound for what it actually is nets us this result. $$nb>b^{n-1}\implies n>b^{n-2}\implies n<4$$ Now, we only need to check the case $n=3$ (which only has a possible solution when $b=2$) and $n=1$. You'll see that there are no solutions for $n=3$ just by testing all base $2$ numbers. $n=1$ implies that a one digit number $x=2x$, which only has the solution $x=0$. This leaves you with $n=2$.

A quick proof that $n=2$ has infinitely many solutions:

  1. Let $x=b^2-1$.
  2. $x=(b-1)b+(b-1)$
  3. $2(b-1)+(b-1)^2=b^2-2b+1+2b-2=b^2-1$
0
On

Bear with me:

For $k \ge 1; b\ge 2$ $(b - 1)^k \le b^k + (-1)^k$. Pf: induction: For $k =1$ then $(b-1)^1 = b^1 + (-1)^1$. For $k = 2$ then $(b-1)^2 = b^2 -2b +1 < b^2 + 1$. If $(b -1)^n \le b^n + (-1)^n$ then $$(b-1)^{n+1} = (b-1)^n(b-1) \le (b^n + (-1)^n)(b-1) = b^{n+1} + (-1)^nb - b^n +(-1)^{n+1} = b^{n+1} + (-1)^{n+1} - b(b^{n-1} + (-1)^n) \ge b^{n+1} + (-1)^{n+1}$$. With equality holding only if $k = 1$. But for $k = 0 ; (b-1)^0 = 1 > 0 = b^0 - 1^0$.

====

Let $n = \sum_{i=0}^k a_i b^k$ be a $k+1$ digit number and $S = \sum_{i=0}^k a_i$

$n - S = \sum_{i=0}^k a_i (b^k - 1) \ge \sum_{i=1}^k a_i (b - 1)^k$.

(we must can/must index from $1$ on the RHS because $a_0*(b^k -1) = 0$)

Now each $a_i \le (b-1)$ so $P = \prod_{i=0}^k a_i = a_k*(b-1)^k$

So $n - S \ge \sum_{i=1}^{k}a_i(b-1)^k$

$= a_k*(b-1)^k+ \sum_{j=1}^{k-1}a_j(b-1)^k$

$\ge P$

And equality only holds if

i) $\sum_{j=1}^{k-1}a_j(b-1)^k= 0$

either a) all $a_j; 1\le j \le k$ are equal to $0$ or b) $k -1 < 1$ i.e. $k < 2$ and $n $ is a one or two digit number.

If a) then $P =0$ and $n - S=0$ which can only happen if $n$ is a one digit number. ($a_i*b^i > a_i$ if $a_i > 0; i > 0$). So b) must hold.

b) If $n$ is a one- digit number then $n - S = 0 = P$ so $P = 0$ and $n= 0$.

So this only true if $n$ is a two digit number or $n = 0$.

ii) Furthermore, If $n$ is a two-digit number this is only true if:

$n = a_1*b + a_0 = a_1 + a_0 + a_1*a_0; a_1 \ne 0$

$a_1(b - (a_0-1)) = 0$

$a_1 \ne 0$ so $a_0 = b- 1$

So the complete set of solutions for $n$ are $\{0, a_1*b + (b-1)|1 \le a_1 < b\}$

1
On

Furthermore, I think i found a solution to my problem : As for example 19 and 29 work in base 10, You can notice for a two digits long number (n=2): $$\Delta (Σ(digits)+(digits)of (number, number + base))= 1 + (base - 1) = base$$ Thus acknowledging that (Σ+)(digits) is localy increasing, those are the only possible numbers for our problem in a base 2.

$$((b−1)∗n+(b−1)^n-b^(n−1)$$ As the aformentioned set given by Δ(Upper, Lower bounds) shows a solution for n>2 digits in multiple bases, i don't know how to proove that they cannot be a solution.