Call $n\in\Bbb N$ "balanced" if the sum of its digits equals the count of its divisors. How many "balanced" numbers are there up to $m$?

172 Views Asked by At

I recently stumbled across a problem about numbers' divisor count (more specifically, how many positive integers are equal to the square of their divisor count - answer was 2: they are 1 and 9).

But I then tried and make it more complex. It goes like this:

Any $n\in\mathbb{N}$ is called "balanced" if and only if the sum of its digits equals the count of its divisors (1 and n included).

Examples of "balanced" numbers would be $1, 2, 11, 22, 36, 84, 101, ...$

I had already found a function that returns the amount of divisors (if $n = \prod_{i=0}^ k p_i^{\alpha_i}$,  $\delta(n) = \prod_{i=0}^ k ({\alpha_i}+1)$), but can't find a bond between digits and count of divisors.

To get some data I coded a program that would give me an idea and it seems that those numbers get rarer the bigger they get. Here's a small table of values:

n "balanced" numbers up to n
100 6
1000 33
10000 211
100000 1559

I am wondering:

  • if there is a way to find the count of "balanced" numbers up to $m \in \mathbb{N}$;
  • if there are infinitely many "balanced" numbers.
2

There are 2 best solutions below

3
On BEST ANSWER

The number of divisors of some positive integer can only be determined by factoring it. But the count is routine for , say , $m\le 10^{10}$

I do not think that we can prove that there are infinite many balanced numbers , but it is extremely likely that there are infinite many primes with digit sum $8$ which would already be enough to establish infinite many such numbers , as pointed out above.

Count of the number of balanced numbers below $10^k$ for $k=1,2,\cdots ,8$ :

1   2
2   6
3   33
4   211
5   1559
6   11405
7   91417
8   786349
5
On

Upto $10^9$ , we have the following values and counts :

1  1
2  3
4  57
8  2246
9  15
10  110
12  2579
14  290
16  101016
18  25383
19  1
20  30062
22  461
24  522698
25  4
26  322
27  508
28  51003
30  244
32  1679303
34  94
36  2067317
38  34
40  428096
44  8728
45  381
46  2
48  1777362
50  169
52  985
54  28363
56  16336
60  1812
63  1
64  7439
72  608

The number of balanced numbers and the average value are :

gp > sum(j=1,length(a),j*a[j])/vecsum(a)*1.0
%4 = 37.145238259866364289306848219426822463
gp > vecsum(a)
%5 = 6754033
gp >