Next Article in Journal
The Marshall–Olkin Power Half-Logistic Distribution for Reliability Modeling of Degradation Data Under Generalized Hybrid Censoring
Previous Article in Journal
Evaluating the Effectiveness of Explainable AI for Adversarial Attack Detection in Traffic Sign Recognition Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

On the Equation x = count(d, x) + n and Its Application

by
Dostonjon Numonjonovich Barotov
1,*,
Ruziboy Numonjonovich Barotov
2,
Svetlana Sergeevna Mikhaylova
1 and
Vadim Gennadievich Feklin
3
1
Department of Mathematics and Data Analysis, Faculty of Information Technology and Big Data Analysis, Financial University Under the Government of the Russian Federation, 4-th Veshnyakovsky Passage, 4, 109456 Moscow, Russia
2
Department of Mathematical Analysis, Faculty of Mathematics, Khujand State University, Mavlonbekov Passage, 1, Khujand 735700, Tajikistan
3
Faculty of Information Technology and Big Data Analysis, Financial University Under the Government of the Russian Federation, 4-th Veshnyakovsky Passage, 4, 109456 Moscow, Russia
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(6), 972; https://doi.org/10.3390/math14060972
Submission received: 26 January 2026 / Revised: 5 March 2026 / Accepted: 11 March 2026 / Published: 13 March 2026

Abstract

In this paper, we consider a discrete equation in natural numbers of the form x = count ( d , x ) + n , where n is a natural number, and count ( d , x ) is the number of occurrences of the digit d { 0 , 1 , , 9 } in the decimal representation of the number x, and estimate the cardinality of the set of its solutions. As a result of the study, it is proved that for each natural number n and each digit d { 2 , 3 , , 9 } , the number of natural solutions of this discrete equation does not exceed two. It is established that in the case d = 1 , for each natural number n, the number of natural solutions of this discrete equation does not exceed three. It is constructively proved by developing an appropriate algorithm that in the case d = 0 , for each natural number k there exists a natural number n k , such that the number of different natural solutions to the equation x = count ( 0 , x ) + n k , even written in decimal notation using no more than three digits such as 0, 8, 9, and having the same number of digits, is not less than k. We also demonstrate the application of the results and of the technique developed and presented in this paper to a system of equations describing the magic state of a special table of numbers, which strengthens and complements some recently obtained results.

1. Introduction

It is known that there are many mathematical problems whose essence lies in the possibility or impossibility of representing an arbitrary element or some element belonging to a given set in the desired form. The above description, due to its breadth, in our opinion, covers both well-known problems—such as the problem of Harshad numbers, the problem of perfect numbers, the problem of generator and self-numbers, the problem of the solvability of algebraic equations, the problem of the diagonalizability of linear operators, and the problem of the representability of a function as a combination of simple functions [1,2,3,4,5,6]—as well as less familiar ones such as the problems presented in [7,8,9,10,11,12], all of which have attractive formulations and are easily explained and understood, but which are quite non-trivial and non-standard to study and solve. Such problems are more theoretical in nature than applied, but methods and techniques have been developed to study and solve them which have applications, in particular, in cryptography, which is the foundation of the modern financial system [13,14,15].
In this paper, we study the problem of analyzing a discrete equation in natural numbers of the form
x = count ( d , x ) + n ,
where n is a natural number and count ( d , x ) is the number of occurrences of the digit d { 0 , 1 , , 9 } in the decimal representation of the number x, from the point of view of the cardinality of the set of its solutions. This problem arises in the analysis, by the restriction method, of a system of the form (1), given in [8] and describing the magic state of a certain table of numbers of the form (2), given in [8]. Specifically, if in system (1) we specify values for all variables except the d-th one, that is, when we consider the restricted version of system (1), then with respect to the d-th variable we obtain an equation of the form (1). In addition, in our opinion, this problem is somewhat similar to the problems of number generators [3], and therefore has an attractive formulation, is easily explained and understood, but nevertheless has a rather non-trivial and non-standard complexity. In particular, the behavior of this problem in the case d 0 differs significantly from the behavior in the case d = 0 . As a result of the study, firstly, it is established that in the case d { 2 , 3 , , 9 } the number of all natural solutions to Equation (1) is uniformly bounded by the number 2 for all natural n, and 2 is achieved for some no more than two-digit natural number n; secondly, it is established that in the case d = 1 the number of all natural solutions for Equation (1) is uniformly bounded by the number three for all natural n, and three is achieved for a no more than two-digit natural number n. Thus, it is argued that Equation (1) differs from the equation x + s ( x ) = n , where s ( x ) is the sum of the digits of the natural x, considered in [3], not only in that it has two parameters and the functions x count ( d , x ) and x + s ( x ) are very different in many properties, but also in that in the case of d { 1 , 2 , , 9 } the number of all natural solutions to Equation (1) is uniformly bound by three, while the equation x + s ( x ) = n , considered in [3], can have many natural solutions as n increases. In addition, an algorithm is also developed that guarantees that in the case of d = 0 , as n grows, Equation (1), like the equation x + s ( x ) = n considered in [3], can have many natural solutions. More precisely, the number of natural solutions, even composed only of the digits 0, 1, 2, and 9 of Equation (1), can grow indefinitely as n grows, and the correctness of this algorithm is also proved. We will also demonstrate one application of the developed technique and the result obtained for a system of equations of form (1) given in [8] and describing the magic state of table of numbers of form (2) given in [8], and establish a result that is a strengthening of Theorem 3 and Remark 2 given in [8] and also complements Theorem 4 and Corollary 1 given in [8].

2. Used Notations

Let S d ( n ) = { x N : x = count ( d , x ) + n } be the set of natural solutions to the equation x = count ( d , x ) + n , and let c a r d ( S d ( n ) ) be the cardinality (number of elements) of the set S d ( n ) , where, as noted above, n is a natural number and count ( d , x ) is the number of occurrences of the digit d { 0 , 1 , , 9 } in the decimal representation of x.
Let Δ d ( m ) = 1 count ( d , m + 1 ) + count ( d , m ) be the (discrete) derivative of the (discrete) function equal to m count ( d , m ) with respect to the (discrete) variable m.
Let c o n c a t ( a , b ) = a p 1 a 1 a 0 b q 1 b 1 b 0 ¯ be a natural number obtained by concatenating natural numbers a and b, whose representations in the decimal system of calculation are equal to a p 1 a 1 a 0 ¯ and b q 1 b 1 b 0 ¯ , respectively, where p and q are two positive integers.
Also, for the sake of clarity, let us recall the commonly used notations: [ x ] is the largest integer not exceeding x, i.e., the integer part of x, and l g ( x ) is the logarithm to base 10 of x.

3. Results

We begin the presentation of the results with a two-sided a priori estimate of the solution to the discrete equation under consideration, which, in general, is not amenable to improvement either from below or from above.
Lemma 1.
If x * N is a solution to the equation x = count ( d , x ) + n , then the following two-sided estimate holds:
n x * n + [ l g ( n ) ] + 2 .
Proof. 
Let x * = count ( d , x * ) + n . The left-hand side of Inequality (2) is obvious, since in view of the definition of the function count ( d , x ) we have
x * = count ( d , x * ) + n 0 + n = n .
Let us prove the validity of the non-obvious right-hand side of Inequality (2). To do this, we show that the following inequality holds:
n + [ l g ( n ) ] + 2 + k count ( d , n + [ l g ( n ) ] + 2 + k ) > n k N .
In view of the inequality
l g ( n ) 1 < [ l g ( n ) ] , n N
we get the inequality
n + [ l g ( n ) ] + 2 + k count ( d , n + [ l g ( n ) ] + 2 + k ) >
> n + l g ( n ) + 1 + k count ( d , n + [ l g ( n ) ] + 2 + k ) .
In view of the inequality
count ( d , n + [ l g ( n ) ] + 2 + k ) i = 0 9 count ( i , n + [ l g ( n ) ] + 2 + k )
and the equality
i = 0 9 count ( i , n + [ l g ( n ) ] + 2 + k ) = [ l g ( n + [ l g ( n ) ] + 2 + k ) ] + 1 ,
we find the inequality
n + l g ( n ) + 1 + k count ( d , n + [ l g ( n ) ] + 2 + k )
n + l g ( n ) + 1 + k [ l g ( n + [ l g ( n ) ] + 2 + k ) ] 1 .
Due to the inequalities
[ l g ( n ) ] l g ( n ) , [ l g ( n + [ l g ( n ) ] + 2 + k ) ] l g ( n + l g ( n ) + 2 + k ) ,
we find the inequality
n + l g ( n ) + k [ l g ( n + [ l g ( n ) ] + 2 + k ) ]
n + l g ( n ) + k l g ( n + l g ( n ) + 2 + k ) = n + k l g n + l g ( n ) + 2 + k n .
Due to the naturalness of n and the inequalities
l g ( n ) + 2 n 2 , k l g 3 + k 1 l g ( 4 ) ,
we get the inequality
n + k l g 1 + l g ( n ) + 2 n + k n n + k l g 1 + 2 + k n
n + k l g 1 + 2 + k 1 = n + k l g 3 + k n + 1 l g ( 3 + 1 ) > n + 0 , 3 > n .
Taking into account inequalities (5)–(8), Inequality (4) is justified. From Inequality (4) the right-hand side of Inequality (2) obviously follows. Lemma 1 is proven.   □
Remark 1.
The two-sided a priori Estimate (2) cannot be improved in the general case, since, for example, if n = 9 and d = 1 , then the boundary natural numbers x 1 = n = 9 and x 2 = n + [ l g ( n ) ] + 2 = 9 + [ l g ( 9 ) ] + 2 = 11 are solutions to the equation x = count ( 1 , x ) + 9 .
For the sake of the completeness of the presentation, we will substantiate one more auxiliary fact; namely, we argue that for a non-zero digit d, the discrete function equal to m count ( d , m ) is non-decreasing in the variable m.
Lemma 2.
The following inequality holds:
Δ d ( m ) 0 m N and d { 1 , 2 , , 9 } .
Proof. 
Let m k 1 m 1 m 0 ¯ be the decimal representation of the number m, i.e.,
m = m k 1 · 10 k 1 + + m 1 · 10 + m 0 ,
where k N , m k 1 0 and m 0 , m 1 , , m k 1 { 0 , 1 , , 9 } . For convenience, we introduce into consideration one variable whose value is equal to zero, i.e., let m k = 0 . Then the number m can be represented as
m = m k · 10 k + m k 1 · 10 k 1 + + m 1 · 10 + m 0 = m k m k 1 m 1 m 0 ¯ .
Let s = s ( m ) = min { j { 0 , 1 , , k } : m j 9 } , i.e., for a given number m, based on its digits, the defining number s = s ( m ) is the smallest index, such that m s 9 . Then, taking into account that the digit d is not equal to zero, and the equality
count ( d , m + 1 ) = count ( d , m ) + δ d ( m s ) , if 1 d < 9 count ( d , m ) s + ε ( m s ) , if d = 9 ,
where
δ d ( m s ) = 1 , if m s = d 1 1 , if m s = d 0 , if m s { d 1 , d } , ε ( m s ) = 1 , if m s = 8 0 , if m s 8 , 0 s k ,
we obtain
Δ d ( m ) = 1 ( count ( d , m + 1 ) count ( d , m ) ) =
= 1 ( count ( d , m ) + δ d ( m s ) count ( d , m ) ) , if 1 d < 9 1 ( count ( d , m ) s + ε ( m s ) count ( d , m ) ) , if d = 9 =
= 1 δ d ( m s ) , if 1 d < 9 1 + s ε ( m s ) , if d = 9 0 ,
Lemma 2 is proven.   □
For clarity, it is appropriate to give one simple example; for example, in the case d = 2 , m = 199 , which clearly shows how Δ d ( m ) is calculated and why it is non-negative.
Δ d ( m ) = ( m + 1 count ( d , m + 1 ) ) ( m count ( d , m ) ) =
= ( 200 count ( 2 , 200 ) ) ( 199 count ( 2 , 199 ) ) = 200 1 199 + 0 = 0 .
Taking into account (10) from the proof of Lemma 2, the following applies:
Corollary 1.
If d { 1 , 2 , , 9 } , then Δ d ( m ) = 0 if and only if one of the following two conditions holds:
(1) 
Both the inequality d 9 and the equality m s = d 1 are satisfied.
(2) 
The equalities d = 9 , s = 0 , and m s = 8 are satisfied.
Despite the fact that, due to the generally unimprovable Estimate (2), the number of potential candidates for a solution grows indefinitely with the growth of n, based on Lemma 2 and Corollary 1, we show that if d { 1 , 2 , , 9 } then the number of natural solutions to an equation of the form (1) is no more than three.
Theorem 1.
For the number c a r d ( S d ( n ) ) , the chain of inequalities
0 c a r d ( S d ( n ) ) 3 n N and d { 1 , 2 , , 9 }
is satisfied, and there are two pairs ( d 1 , n 1 ) , ( d 2 , n 2 ) { 1 , 2 , , 9 } × N such that c a r d ( S d 1 ( n 1 ) ) = 0 and c a r d ( S d 2 ( n 2 ) ) = 3 .
Proof. 
The left-hand side of Inequality (11), in view of the definition of c a r d ( S d ( n ) ) , is obvious, and we prove the right-hand side of Inequality (11) by contradiction. Let there exist n * N and d * { 1 , 2 , , 9 } , such that c a r d ( S d * ( n * ) ) > 3 . Then, there exist four natural numbers a * < b * < p * < q * , such that a * , b * , p * , q * S d * ( n * ) . Hence, by virtue of Lemma 2 and the inequality a * < b * < p * < q * , we obtain
0 = n * n * = q * count ( d * , q * ) ( a * count ( d * , a * ) )
a * + 3 count ( d * , a * + 3 ) ( a * count ( d * , a * ) ) = Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) .
To complete the proof, it remains to be shown that the following holds:
Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) > 0 .
To prove (12) with respect to d * , we consider three cases.
Case 1. Let d * = 9 . If s ( a * ) 0 or a * s 8 , then by Corollary 1, Δ d * ( a * ) > 0 and, hence, by Lemma 2, we find that Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) 0 + 0 + Δ d * ( a * ) > 0 ; that is, Inequality (12) holds. And if s ( a * ) = 0 and a * s = 8 , then s ( a * + 1 ) 0 and consequently, by virtue of Corollary 1, Δ d * ( a * + 1 ) > 0 is satisfied and, hence, by virtue of Lemma 2, we see that Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) 0 + Δ d * ( a * + 1 ) + 0 > 0 ; that is, Inequality (12) is satisfied.
Case 2. Let 9 > d * > 1 . If a * s d * 1 , then by Corollary 1, Δ d * ( a * ) > 0 and, hence, by Lemma  2, we obtain Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) 0 + 0 + Δ d * ( a * ) > 0 ; that is, Inequality (12) holds. And if a * s = d * 1 , then s ( a * + 1 ) = 0 and the digit in the place of the one in a * + 1 is equal to 0 and, therefore, by virtue of Corollary 1, the condition Δ d * ( a * + 1 ) > 0 is satisfied, and, therefore, by virtue of Lemma 2, we obtain that Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) 0 + Δ d * ( a * + 1 ) + 0 > 0 ; that is, the Inequality (12) is satisfied.
Case 3. Let d * = 1 . If a * s 0 , then by Corollary 1, Δ d * ( a * ) > 0 and, hence, by Lemma 2, we obtain that Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) 0 + 0 + Δ d * ( a * ) > 0 ; that is, Inequality (12) holds. And if a * s = 0 , then s ( a * + 1 ) = 0 , and the digit in the units place of the number a * + 1 is equal to 0 in the case s ( a * ) > 0 and is equal to 1 in the case s ( a * ) = 0 . Hence, if s ( a * ) = 0 , then Δ d * ( a * + 1 ) > 0 and thus, by Lemma 2, we obtain that Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) = Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + 0 = Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) 0 + Δ d * ( a * + 1 ) > 0 ; that is, Inequality (12) is satisfied. Also, if s ( a * ) > 0 , then Δ d * ( a * + 1 ) = 0 and Δ d * ( a * + 2 ) > 0 and thus, we obtain Δ d * ( a * + 2 ) + Δ d * ( a * + 1 ) + Δ d * ( a * ) = Δ d * ( a * + 2 ) + 0 + 0 = Δ d * ( a * + 2 ) > 0 ; that is, the Inequality (12) is satisfied.
Note that if ( d 1 , n 1 ) = ( 1 , 100 ) and ( d 2 , n 2 ) = ( 1 , 99 ) , then S d 1 ( n 1 ) = and S d 2 ( n 2 ) = { 99 , 100 , 101 } . Indeed, firstly, if the equation x = count ( 1 , x ) + 100 has a natural solution, then by Lemma 1 this is a natural number from 100 to 104, but none of the five natural numbers from 100 to 104 is a solution, since
100 { 100 count ( 1 , 100 ) , 101 count ( 1 , 101 ) , 102 count ( 1 , 102 ) ,
103 count ( 1 , 103 ) , 104 count ( 1 , 104 ) } = { 99 , 101 , 102 , 103 } ,
and secondly, the numbers 99, 100, 101 are solutions to the equation x = count ( 1 , x ) + 99 , since
{ 99 } = 99 count ( 1 , 99 ) , 100 count ( 1 , 100 ) , 101 count ( 1 , 101 ) .
Theorem 1 is completely proven.   □
Taking into account Case 3, the following fact follows directly from the proof of Theorem 1.
Corollary 2.
If ( d , n ) { 1 , 2 , , 9 } × N and c a r d ( S d ( n ) ) = 3 , then d = 1 .
It is quite unexpected that the behavior of Equation (1) in the case d = 0 differs significantly from other cases d 0 , since if d 0 , then we have the equality
max n { 1 , 2 , , 99 } c a r d ( S d ( n ) ) = max n N c a r d ( S d ( n ) ) .
Therefore, a particular property found for a natural n with a maximum of two digits turns into a general one, and if d = 0 , then an equality of the form (13) is violated. It is curious that the very first natural n, for which the equation has at least three solutions, is greater than 10 10 . For this case, we will develop an algorithm that guarantees that the number of different natural solutions to the equation x = count ( 0 , x ) + n , even those composed only of the digits 0, 1, 2, and 9, and having the same number of digits, can grow indefinitely as n grows, and we will prove the correctness of this algorithm.
We present pseudocode for an algorithm whose basic premise is based on appending a prefix to m current solutions with the same digit length. This allows identifying a new solution and forming the next set of m + 1 solutions, all with the same digit length and corresponding to the updated parameter value. The process is repeated iteratively.
The correctness of Algorithm 1 is confirmed by the following theorem.
Algorithm 1 Finding n and a Set of k Natural s-Digit Solutions to x = count ( 0 , x ) + n .
For a given natural number k, finds the value of the natural parameter n and a set of k natural s-digit numbers that will be solutions to the corresponding the equation x = count ( 0 , x ) + n .
Input: A natural number k
Output: A natural number n, a set of k natural numbers, and a natural number s
1.  function  N a n d R ( k )
2.         n : = 1 ,    s : = 1 ,    x 1 : = 1
3.       for m from 1 to  k 1
4.       do
5.              for i from 1 to m
6.              do
7.                     x i : = c o n c a t 2 · 10 n + 1 , x i
8.              end for
9.               x m + 1 : = 2 · 10 n + s + 1 1
10.              ( n , s ) : = 2 · 10 n + s + 1 1 , n + s + 2
11.       end for
12.       return  n , x 1 , x 2 , , x k , s
13. end function
Theorem 2.
For a given arbitrary natural number k, the corresponding triple n , x 1 , x 2 , , x k , s returned by Algorithm 1 has the following property: each of the k elements of the set x 1 , x 2 , , x k is an s-digit natural number composed only of the digits 0, 1, 2, and 9 and satisfies the equation x = count ( 0 , x ) + n .
Proof. 
It is convenient to produce a proof by induction on k.
  • Let k = 1 . Then Algorithm 1 returns a triple of the form n , { x 1 } , s = 1 , { 1 } , 1 . In this case, everything is obvious because x 1 = 1 is a single-digit natural number composed of only the digit 1, and the equality x 1 = count ( 0 , x 1 ) + n holds.
  • Let k = l . Then suppose that the corresponding triple n , x 1 , x 2 , , x l , s returned by Algorithm 1 has the following property: each of the l elements of the set x 1 , x 2 , , x l is an s-digit natural number consisting only of the digits 0, 1, 2, and 9, and satisfies the equation x = count ( 0 , x ) + n .
  • Based on 1 and 2, we need to argue that each of the l + 1 elements of the set 2 · 10 s + n + 1 1 , c o n c a t ( 2 · 10 n + 1 , x 1 ) , c o n c a t ( 2 · 10 n + 1 , x 2 ) , , c o n c a t ( 2 · 10 n + 1 , x l ) is an ( s + n + 2 ) -digit natural number consisting only of the digits 0, 1, 2, and 9, and satisfies the equation x = count ( 0 , x ) + 2 · 10 n + s + 1 1 .
Indeed, given that the numbers x 1 , x 2 , , x l composed of the digits 0, 1, 2, 9 are different, we find that the numbers c o n c a t ( 2 · 10 n + 1 , x 1 ) , c o n c a t ( 2 · 10 n + 1 , x 2 ) , , c o n c a t ( 2 · 10 n + 1 , x l ) will also be composed of the digits 0, 1, 2, 9 and will be different. Furthermore, given that the numbers x 1 , x 2 , , x l are s-digit natural numbers, we find that the numbers c o n c a t ( 2 · 10 n + 1 , x 1 ) , c o n c a t ( 2 · 10 n + 1 , x 2 ) , , c o n c a t ( 2 · 10 n + 1 , x l ) composed of the digits 0, 1, 2, and 9 are also ( s + n + 2 ) -digit natural numbers. Since the number 2 · 10 s + n + 1 1 composed of the digits 1 and 9 is also a ( s + n + 2 ) -digit natural number starting with 1, we find that all l + 1 numbers
2 · 10 s + n + 1 1 , c o n c a t ( 2 · 10 n + 1 , x 1 ) , c o n c a t ( 2 · 10 n + 1 , x 2 ) , , c o n c a t ( 2 · 10 n + 1 , x l )
are distinct and are ( s + n + 2 ) -digit natural numbers consisting of the digits 0, 1, 2, and 9. It remains to be shown that these l + 1 distinct ( s + n + 2 ) -digit natural numbers satisfy the equation
x = count ( 0 , x ) + 2 · 10 n + s + 1 1 .
We have
2 · 10 n + s + 1 1 count 0 , 2 · 10 n + s + 1 1 = 2 · 10 n + s + 1 1 0 = 2 · 10 n + s + 1 1 ,
c o n c a t ( 2 · 10 n + 1 , x i ) count 0 , c o n c a t ( 2 · 10 n + 1 , x i ) =
= 2 · 10 n + 1 · 10 s + x i count 0 , 2 · 10 n + 1 count 0 , x i = 2 · 10 n + s + 1 n 1 +
+ x i count 0 , x i = 2 · 10 n + s + 1 n 1 + n = 2 · 10 n + s + 1 1 i { 1 , 2 , . . . , l } .
Theorem 2 is proven.   □
Remark 2.
If we replace the four lines numbered 2, 7, 9, and 10 in Algorithm 1 with four lines of the form
n : = 8 , s : = 1 , x 1 : = 8 , x i : = c o n c a t 9 · 10 n + 1 , x i , x m + 1 : = 9 · 10 n + s + 1 1 ( n , s ) : = 9 · 10 n + s + 1 1 , n + s + 2 ,
respectively, we obtain another similar algorithm, the correctness of which is proved in the same way as the correctness of Algorithm 1, and which guarantees that the number of different natural solutions to the equation x = count ( 0 , x ) + n , even consisting only of the digits 0, 8, and 9 and having the same number of digits, can grow infinitely as n increases.
For clarity, it is appropriate to present the result of Algorithm 1 in the case k 3 .
1.
If k = 1 , then according to the description/definition of Algorithm 1, we have a triple of the form n , { x 1 } , s = 1 , { 1 } , 1 . In this case, it is obvious that x 1 = 1 is a single-digit natural number consisting only of the digit 1, and satisfies the equation x = count ( 0 , x ) + 1 .
2.
If k = 2 , then to all the solutions found in point 1 (although there is only one solution in it so far) we add the prefix 2 · 10 n + 1 = 2 · 10 1 + 1 to obtain updated solutions and one more solution is 2 · 10 n + s + 1 1 = 2 · 10 1 + 1 + 1 1 , so we get a triple in the form n , x 1 , x 2 , s = 1999 , 2001 , 1999 , 4 . Note that the four-digit numbers 2001 and 1999 consisting of the digits 0, 1, 2, and 9 are solutions to the equation x = count ( 0 , x ) + 1999 .
3.
If k = 3 , then to all the solutions found in point 2 (there are two solutions so far) we add the prefix 2 · 10 n + 1 = 2 · 10 1999 + 1 to obtain updated solutions and one more solution is 2 · 10 n + s + 1 1 = 2 · 10 1999 + 4 + 1 1 , so we get a triple in the form n , x 1 , x 2 , x 3 , s =
= 2 · 10 2004 1 , c o n c a t ( 2 · 10 2000 , 2001 ) , c o n c a t ( 2 · 10 2000 , 1999 ) , 2 · 10 2004 1 , 2005 .
Note that the 2005-digit numbers
c o n c a t ( 2 · 10 2000 , 2001 ) , c o n c a t ( 2 · 10 2000 , 1999 ) , 2 · 10 2004 1 ,
consisting of the digits 0, 1, 2, and 9 are solutions to the equation x = count ( 0 , x ) + 2 · 10 2004 1 .
In view of the concreteness of the equation under consideration, it is, in our opinion, appropriate to note that the above-mentioned fact that the number of different natural solutions to the equation x = count ( 0 , x ) + n , representable in decimal notation using no more than three given digits and having the same number of digits, can grow infinitely with the growth of n, and its algorithmic proof, among other things, complements and refines some valuable general results [16,17,18,19], which can be used to confirm that the number of natural solutions to the equation x = count ( 0 , x ) + n is not uniformly bounded for all natural n.

4. Application of the Developed Technique and the Obtained Result to a System of Equations That Describes the Magic State of a Table of Numbers

In this section we will demonstrate one application of the technique developed above and the above-obtained result to the system of equations of the form (1), given in [8], describing the magic state of the table of numbers of the form (2), given in [8]. We will prove the following proposition, which strengthens some of the results given in [8].
Proposition 1.
There are infinitely many non-negative integers n such that the system
x 0 = 1 + count ( 0 , n ) + count ( 0 , x 0 ) + count ( 0 , x 1 ) + + count ( 0 , x 9 ) x 1 = 1 + count ( 1 , n ) + count ( 1 , x 0 ) + count ( 1 , x 1 ) + + count ( 1 , x 9 ) x 9 = 1 + count ( 9 , n ) + count ( 9 , x 0 ) + count ( 9 , x 1 ) + + count ( 9 , x 9 )
has at least 20 different natural solutions whose coordinates have the same number of digits.
Proof. 
To do this, it is sufficient to prove, firstly, that if m vectors
( x 0 ( 1 ) , x 1 ( 1 ) , , x 9 ( 1 ) ) , ( x 0 ( 2 ) , x 1 ( 2 ) , , x 9 ( 2 ) ) , , ( x 0 ( m ) , x 1 ( m ) , , x 9 ( m ) )
such that x i ( j ) is an l-digit natural number i { 0 , 1 , , 9 } and j { 1 , 2 , , m } are solutions to System (14) in the case n = n * , then for any natural number p, m vectors
( c o n c a t ( p , x 0 ( 1 ) ) , c o n c a t ( p , x 1 ( 1 ) ) , , c o n c a t ( p , x 9 ( 1 ) ) ) ,
( c o n c a t ( p , x 0 ( 2 ) ) , c o n c a t ( p , x 1 ( 2 ) ) , , c o n c a t ( p , x 9 ( 2 ) ) ) , ,
( c o n c a t ( p , x 0 ( m ) ) , c o n c a t ( p , x 1 ( m ) ) , , c o n c a t ( p , x 9 ( m ) ) )
such that c o n c a t ( p , x i ( j ) ) is an ( l + [ l g ( p ) ] + 1 ) -digit natural number i { 0 , 1 , , 9 } and j { 1 , 2 , , m } are solutions for System (14) in the case
n = n ( p ) = 999 9 r 9 ( p ) times   888 8 r 8 ( p ) times 000 0 r 0 ( p ) times ¯ ,
where
r t ( p ) = p · 10 l 10 · count ( t , p ) + count ( t , n * ) , t { 0 , 1 , . . . , 9 } ,
Secondly, it is necessary to present 20 vectors whose coordinates have the same number of digits, which are solutions for System (14) for some value of the parameter n.
Let us provide the rationale for the first part. Let the vectors given in (15) be such that x i ( j ) is an l-digit natural number i { 0 , 1 , , 9 } and j { 1 , 2 , , m } is a solution for System (14) in the case n = n * . Then we show that the vectors defined in (16), whose coordinates are ( l + [ l g ( p ) ] + 1 ) -digit natural numbers, are solutions for System (14) in the case of the equality given in (17). By virtue of the equalities
c o n c a t ( p , x i ( j ) ) = p · 10 l + x i ( j ) , count ( i , c o n c a t ( p , x d ( j ) ) ) = count ( i , p ) + count ( i , x d ( j ) ) ,
which follow from the fact that i { 0 , 1 , . . . , 9 } and x i ( j ) is an l-digit natural number and p is a natural number, we have
c o n c a t ( p , x i ( j ) ) d = 0 9 count ( i , c o n c a t ( p , x d ( j ) ) ) = p · 10 l + x i ( j )
d = 0 9 count ( i , p ) + count ( i , x d ( j ) ) = p · 10 l + x i ( j ) d = 0 9 count ( i , p ) d = 0 9 count ( i , x d ( j ) ) =
= p · 10 l 10 · count ( i , p ) + x i ( j ) d = 0 9 count ( i , x d ( j ) ) = p · 10 l 10 · count ( i , p ) +
+ 1 + count ( i , n * ) p N and i { 0 , 1 , , 9 } and j { 1 , 2 , , m } ,
since the equality x i ( j ) d = 0 9 count ( i , x d ( j ) ) = 1 + count ( i , n * ) is satisfied.
To complete the proof, it remains for us to present 20 «initial» vectors that satisfy the condition of the already justified first part; i.e., whose coordinates have the same number of digits and which are solutions for System (14) for some value of the parameter n. By adding the prefix - and the natural parameter p to the coordinates of these 20 «initial» vectors and successively substituting all natural numbers into the prefix parameter p, we obtain that there are infinitely many countably natural n, so that System (14) has at least 20 different natural solutions, the coordinates of which have the same number of digits. We present 20 vectors of three-digit natural numbers of the form
( 200 , 214 , 215 , 212 , 214 , 213 , 225 , 216 , 212 , 218 ) , ( 200 , 215 , 214 , 213 , 213 , 212 , 226 , 216 , 211 , 219 ) , ( 200 , 214 , 215 , 213 , 213 , 212 , 226 , 216 , 212 , 218 ) , ( 200 , 214 , 216 , 212 , 213 , 212 , 225 , 217 , 212 , 218 ) , ( 199 , 215 , 214 , 213 , 213 , 212 , 226 , 216 , 211 , 220 ) , ( 200 , 216 , 214 , 211 , 214 , 211 , 226 , 217 , 212 , 218 ) , ( 200 , 216 , 214 , 212 , 213 , 211 , 226 , 217 , 211 , 219 ) , ( 200 , 215 , 213 , 214 , 213 , 213 , 225 , 216 , 211 , 219 ) , ( 199 , 215 , 213 , 214 , 213 , 213 , 225 , 216 , 211 , 220 ) , ( 200 , 215 , 215 , 212 , 212 , 213 , 226 , 216 , 211 , 219 ) , ( 199 , 216 , 214 , 212 , 213 , 211 , 226 , 217 , 211 , 220 ) , ( 200 , 216 , 214 , 211 , 214 , 212 , 225 , 217 , 211 , 219 ) , ( 199 , 216 , 215 , 211 , 212 , 212 , 226 , 217 , 211 , 220 ) , ( 200 , 215 , 214 , 212 , 214 , 213 , 225 , 216 , 211 , 219 ) , ( 199 , 215 , 214 , 212 , 214 , 213 , 225 , 216 , 211 , 220 ) , ( 200 , 216 , 215 , 211 , 212 , 212 , 226 , 217 , 211 , 219 ) , ( 199 , 216 , 214 , 211 , 214 , 212 , 225 , 217 , 211 , 220 ) , ( 200 , 215 , 216 , 211 , 212 , 212 , 226 , 217 , 212 , 218 ) , ( 199 , 215 , 215 , 212 , 212 , 213 , 226 , 216 , 211 , 220 ) , ( 200 , 215 , 215 , 211 , 212 , 215 , 225 , 216 , 212 , 218 ) ,
which are solutions of System (14) for
n = 999 9 r 9 times   888 8 r 8 times 000 0 r 0 times ¯ ,
where
( r 0 , r 1 , r 2 , r 3 , r 4 , r 5 , r 6 , r 7 , r 8 , r 9 ) = ( 197 , 205 , 201 , 210 , 211 , 210 , 223 , 215 , 210 , 217 ) ,
which can be seen here by substituting them directly into the system and checking the feasibility of all the necessary equalities either manually or on a computer. We checked them and these 20 vectors were experimentally identified by us using a computer and the above technique based on adding a prefix. Proposition 1 is proven.   □
Remark 3.
Proposition 1 is a strengthening of Theorem 3 and Remark 2 given in [8], and also complements Theorem 4 and Corollary 1 given in [8].

5. Discussion

Given the very rapid “astronomical” growth of n k , i.e., the fact that the first n for which the equation x = count ( 0 , x ) + n has at least one solution is 1, the first n for which the equation x = count ( 0 , x ) + n has at least two solutions is 9, and the first n for which the equation x = count ( 0 , x ) + n has at least three solutions is greater than 10 10 , it is appropriate to note the following problem, similar to the problem posed for the equation x + s ( x ) = n and considered, for example, in [3], as a task for future research: develop an approach (algorithm) that, based on a given k, effectively finds the minimum n for which the equation x = count ( 0 , x ) + n has at least k different natural solutions. It also makes sense, on the one hand, to generalize the obtained results corresponding to the decimal number system to other number systems, and on the other hand, to find applied, cryptographic or other mathematical problems, such as, for example, the problems presented in [20,21,22,23], which the results and approaches presented in this paper are used to find solutions for.

6. Conclusions

In this paper we have proven that the number of natural solutions to Equation (1) in the case d { 2 , 3 , , 9 } does not exceed two, and in the case d = 1 , does not exceed three. We have constructively proven that in the case d = 0 , the number of different natural solutions to Equation (1), representable in decimal notation using no more than three given digits (e.g., 0, 8, and 9) and having the same number of digits, can grow infinitely with increasing n. In addition, the developed technique and the obtained result were applied to System (14), and as a result it was established that there exist infinitely many countably natural n, such that System (14) has at least 20 different natural solutions whose coordinates have the same number of digits. This is a strengthening of Theorem 3 and Remark 2 given in [8], and also complements Theorem 4 and Corollary 1 given in [8].

Author Contributions

Conceptualization, D.N.B. and R.N.B.; methodology, D.N.B.; validation, R.N.B. and S.S.M.; formal analysis, D.N.B.; investigation, D.N.B.; writing—original draft preparation, S.S.M.; writing—review and editing, V.G.F.; supervision, V.G.F. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

No new data were created or analyzed in this study.

Acknowledgments

The authors sincerely thank the reviewers for their valuable comments, which enabled them to significantly improve the quality and content of this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Gupta, S.S. On Some Special Numbers. In Exploring the Beauty of Fascinating Numbers; Springer Nature: Singapore, 2025; pp. 527–565. [Google Scholar] [CrossRef]
  2. Pollack, P.; Shevelev, V. On perfect and near-perfect numbers. J. Number Theory 2012, 132, 3037–3046. [Google Scholar] [CrossRef]
  3. Alekseyev, M.A.; Sloane, N.J.A. On Kaprekar’s Junction Numbers. arXiv 2021, arXiv:2112.14365. [Google Scholar] [CrossRef]
  4. Khovanskii, A.G. Variations on the theme of solvability by radicals. Proc. Steklov Inst. Math. 2007, 259, 82–100. [Google Scholar] [CrossRef]
  5. Beklemishev, D.V. Course of Analytical Geometry and Linear Algebra; Nauka: Moscow, Russia, 1971; 328p. (In Russian) [Google Scholar]
  6. Yakkou, H.B.; Kakanou, K.R.; Tiebekabe, P. Narayana numbers as product of three repdigits in base g. Acta Comment. Univ. Tartu. Math. 2023, 27, 319–334. [Google Scholar] [CrossRef]
  7. Khovanova, T. Autobiographical Numbers. arXiv 2008, arXiv:0803.0270v1. [Google Scholar] [CrossRef]
  8. Barotov, D.N. On the Analysis of a System of Equations Containing a Parameter n and Describing a Special State of a Certain Table of Numbers. Mathematics 2026, 14, 119. [Google Scholar] [CrossRef]
  9. Pchelintsev, S.V. On Identities of Model Algebras. Izv. Math. 2023, 87, 1210–1226. [Google Scholar] [CrossRef]
  10. Sudakov, V.; Zhukov, A. Fuzzy Domination Graphs in Decision Support Tasks. Mathematics 2023, 11, 2837. [Google Scholar] [CrossRef]
  11. Volosova, N.V. The p-convexity functor for Lp(X)-spaces. Sb. Math. 2022, 213, 734–743. [Google Scholar] [CrossRef]
  12. Mikeš, J.; Stepanov, S.; Tsyganok, I. New applications of the Ahlfors Laplacian: Ricci almost solitons and general relativistic vacuum constraint equations. J. Geom. Phys. 2025, 209, 105414. [Google Scholar] [CrossRef]
  13. Barotov, D.N. Concave Continuations of Boolean-like Functions and Some of Their Properties. Bull. Irkutsk. State Univ. Ser. Math. 2025, 51, 82–100. (In Russian) [Google Scholar] [CrossRef]
  14. Abramova, M.A.; Krivoruchko, S.V.; Lunyakov, O.V.; Fiapshev, A.B. Theoretical and Methodological Perspective on the Prerequisites of Emergence and Peculiarities of the Functioning of Decentralized Finance. Financ. Theory Pract. 2025, 29, 80–96. [Google Scholar] [CrossRef]
  15. Krylova, L.V. Digital Currencies in Cross-Border Payments: Use under Sanctions. Financ. Theory Pract. 2024, 28, 101–111. [Google Scholar] [CrossRef]
  16. Allouche, J.-P.; Shallit, J. Automatic Sequences: Theory, Applications, Generalizations; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar] [CrossRef]
  17. Allouche, J.-P.; Shallit, J. The Ring of q-regular Sequences. Theor. Comput. Sci. 1992, 98, 163–197. [Google Scholar] [CrossRef]
  18. Drmota, M.; Morgenbesser, J.F. Generalized Thue-Morse sequences of squares. Isr. J. Math. 2012, 190, 157–193. [Google Scholar] [CrossRef]
  19. Gelfond, A.O. Sur les nombres qui ont des propriétés additives et multiplicatives données. Acta Arith. 1968, 13, 259–265. [Google Scholar] [CrossRef]
  20. Ivanov, A.V.; Tsaregorodtsev, A.V. Cybersecurity of the Digital Ruble in the System of Destructive Events of the Digital Space. Digit. Solut. Artif. Intell. Technol. 2025, 1, 44–54. [Google Scholar] [CrossRef]
  21. Ryzhenko, A.A.; Kozminych, S.I. Undeclared File Architecture Features. Automated Office, Text Editor, Docx Format. Digit. Solut. Artif. Intell. Technol. 2025, 1, 60–68. [Google Scholar] [CrossRef]
  22. Tulupova, O.P.; Zholobova, G.N. Gaussian Process Regression for Product Geometry Prediction in CAE Modeling. Digit. Solut. Artif. Intell. Technol. 2025, 1, 43–50. [Google Scholar] [CrossRef]
  23. Barotov, D.N. On the Existence and Properties of Convex Extensions of Boolean Functions. Math. Notes 2024, 115, 489–505. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Barotov, D.N.; Barotov, R.N.; Mikhaylova, S.S.; Feklin, V.G. On the Equation x = count(d, x) + n and Its Application. Mathematics 2026, 14, 972. https://doi.org/10.3390/math14060972

AMA Style

Barotov DN, Barotov RN, Mikhaylova SS, Feklin VG. On the Equation x = count(d, x) + n and Its Application. Mathematics. 2026; 14(6):972. https://doi.org/10.3390/math14060972

Chicago/Turabian Style

Barotov, Dostonjon Numonjonovich, Ruziboy Numonjonovich Barotov, Svetlana Sergeevna Mikhaylova, and Vadim Gennadievich Feklin. 2026. "On the Equation x = count(d, x) + n and Its Application" Mathematics 14, no. 6: 972. https://doi.org/10.3390/math14060972

APA Style

Barotov, D. N., Barotov, R. N., Mikhaylova, S. S., & Feklin, V. G. (2026). On the Equation x = count(d, x) + n and Its Application. Mathematics, 14(6), 972. https://doi.org/10.3390/math14060972

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop