DIGIT PATTERNS AND ENTROPY OF POWERS OF TWO IN ODD-BASE NUMERAL SYSTEMS

ЦИФРОВЫЕ ЗАКОНОМЕРНОСТИ СТЕПЕНЕЙ ДВОЙКИ В НЕЧЕТНЫХ СИСТЕМАХ СЧИСЛЕНИЯ
Kadyrbek A.N. Aliev Ya.
Цитировать:
Kadyrbek A.N., Aliev Ya. DIGIT PATTERNS AND ENTROPY OF POWERS OF TWO IN ODD-BASE NUMERAL SYSTEMS // Universum: технические науки : электрон. научн. журн. 2026. 4(145). URL: https://7universum.com/ru/tech/archive/item/22350 (дата обращения: 07.05.2026).
Прочитать статью:
DOI - 10.32743/UniTech.2026.145.4.22350
Статья поступила в редакцию: 13.03.2026
Принята к публикации: 14.04.2026
Опубликована: 28.04.2026

 

ABSTRACT

This study investigates how powers of two behave when represented in numeral systems with odd bases, specifically bases 3, 5, and 7. While representations of  are well understood in binary and decimal systems, their structural properties in oddbase numeral systems remain relatively unexplored.

Using a computational approach, we analyze the representations of  for 1 ≤ n ≤ 100 and examine several structural characteristics, including digit length, digit frequency distribution, and entropy. The results confirm that digit length follows the logarithmic growth expected from positional numeral systems. However, digit distributions differ across bases: base 3 exhibits nearly balanced digit frequencies, while bases 5 and 7 show increasing bias toward lower digit values.

Entropy analysis indicates that the digit sequences are not completely random but instead reflect deterministic structural constraints imposed by the numeral system. These findings contribute to a better understanding of how numeral bases influence the representation of exponential sequences and may have implications for information representation and symbolic sequence analysis.

АННОТАЦИЯ

В данной работе исследуется поведение степеней числа два при представлении в системах счисления с нечетным основанием, в частности в системах с основаниями 3, 5 и 7. С использованием вычислительных методов анализируются представления  при , включая длину записи числа, распределение цифр и энтропию Шеннона. Результаты показывают, что длина записи числа растет логарифмически в соответствии с теоретическими ожиданиями позиционных систем счисления. При этом распределение цифр различается между системами: в троичной системе наблюдается почти равномерное распределение, тогда как в системах с основаниями 5 и 7 появляется заметное смещение в сторону меньших цифр. Полученные результаты показывают, что цифровые последовательности степеней двойки обладают структурной закономерностью, обусловленной свойствами системы счисления.

 

Keywords: numeral systems, powers of two, digit distribution, Shannon entropy, positional representation, computational analysis.

Ключевые слова: системы счисления, степени двойки, распределение цифр, энтропия Шеннона, позиционные системы, вычислительный анализ.

 

Introduction

Positional numeral systems play a fundamental role in mathematics, computer science, and digital information processing. The choice of numeral base determines how numbers are represented, stored, and manipulated in computational environments. In modern computing, binary representation is dominant due to its compatibility with digital hardware. However, analyzing numerical representations in alternative bases can reveal structural properties that remain hidden in conventional systems.

Powers of two form a particularly important numerical sequence because of their central role in digital computation, algorithm design, and information storage. In binary systems, powers of two have a simple representation consisting of a single leading digit followed by zeros. In other numeral bases, however, the representation of  becomes more complex and may reveal interesting structural patterns in digit growth and distribution.

While extensive research has examined number representations in binary and decimal systems, comparatively little attention has been devoted to the behavior of exponential sequences in odd-base numeral systems such as base 3, base 5, and base 7. These systems are of theoretical interest in number theory and computational mathematics and also appear in studies related to alternative computing architectures and symbolic information processing [1]–[3].

Odd-base systems introduce distinct structural characteristics in positional representation. For instance, ternary (base 3) systems have attracted attention for their potential advantages in theoretical computing architectures, including possible reductions in circuit complexity and energy consumption [4]. Although bases such as 5 and 7 are less common in practical hardware implementations, they play important roles in modular arithmetic, pseudo-random sequence generation, and cryptographic analysis [5]. The transition from even to odd bases changes carry propagation mechanisms during digit expansion, which may influence digit distribution and representation length.

Despite these developments, there remains a lack of comparative studies examining digit behavior across multiple odd bases. The bases 3, 5, and 7 were selected as representative odd numeral systems of increasing magnitude. This choice allows for a structured comparison of how digit patterns evolve as the base increases, while maintaining computational simplicity. While larger bases could also be considered, these values provide a minimal yet sufficient set for identifying structural trends.

Several studies have investigated particular aspects of digit behavior in numeral systems. Aliyev [6] analyzed repeating digit structures in ternary expansions of 2 n, identifying patterns of structural alternation. Spiegelhofer [7] explored relationships between digit sums in bases 2 and 3, demonstrating connections in distributional properties. Kreher and Stinson [8] studied palindromic structures in binary representations of powers of two, while Masakova and Pelantova [9] examined periodicity properties in positional numeral systems. However, most of these works focus on individual bases or isolated digit properties rather than performing a comparative analysis across multiple odd-base systems.

From a broader computational perspective, numeral systems influence both numerical processing and symbolic representation. Research in numerical cognition and computational theory suggests that the structure of place-value systems affects how numerical information is interpreted and processed [2], [3]. Consequently, investigating numerical representations across different bases can provide insights into both theoretical and computational properties of number systems.

Despite these developments, there remains a lack of comparative studies examining the digit-level structure of exponential sequences across multiple odd bases. In particular, limited attention has been given to how digit length, digit frequency distribution, and symbolic randomness evolve in representations of powers of two in bases 3, 5, and 7.

Information-theoretic measures provide an additional framework for analyzing such patterns. Shannon entropy, commonly used to quantify randomness in symbolic sequences, has been applied to digit expansions in order to identify underlying structural regularities [10]. Prior research has shown that positional systems can impose constraints on digit distributions, affecting entropy and symbolic variability. These insights suggest that studying the digit patterns of exponential sequences may contribute to a deeper understanding of numerical representation and symbolic complexity. The present study addresses this gap by analyzing the representations of  in bases 3, 5, and 7 using computational and statistical methods. Specifically, we examine three main questions:

  1. How does the digit length of  grow as n increases in different odd-base numeral systems?
  2. How are digits distributed within these representations?
  3. Do the resulting digit sequences exhibit random behavior, measured using Shannon entropy, or do they reflect deterministic structural patterns?

 By evaluating the representations of  for  in the selected bases, we provide empirical insights into how numeral base influences the structural properties of exponential sequences. The analysis integrates theoretical foundations from number systems and information theory with computational experimentation.

Materials and methods

This study employs a computational and theoretical approach to examine how positional numeral systems with odd bases influence the representation of powers of two, . We analyze the digit structure, digit length, frequency distribution, and entropy of these representations in bases 3, 5, and 7 for n = 1 to 100. This range captures both compact and expanded representations while remaining computationally manageable. The methodology combines techniques from number theory and symbolic sequence analysis, following approaches used in prior studies of digit complexity and periodicity [7], [9].

Base Conversion

To analyze digit structure across bases, we first compute  for each  using integer exponentiation. Each result is then converted from decimal (base 10) into base 3, 5, and 7 using repeated division. This technique recursively extracts the least significant digit via the modulus operator, followed by division and truncation— a classical algorithm for radix conversion outlined in foundational texts [1].

The conversion process is illustrated in Figure 1, which outlines the repeated division algorithm used to obtain base-b representations.

 

Figure 1. Algorithm for converting a decimal number into base b using repeated division. At each step, the remainder defines the next digit, and the quotient is used for subsequent iterations until the value becomes zero. The sequence of digits is then reversed to obtain the correct positional representation.

 

The output of this conversion is stored as an array of digits, reversed to reflect proper positional order. Leading zeros are excluded. To ensure correctness, we validated our implementation against built-in language functions (e.g., Python’s ‘int‘ base conversion) for small test cases. This transformation allows analysis of both representation length and internal digit structure.

We calculated digit length by simply counting the number of digits in each base-b representation. This matches the theoretical expectation derived from logarithmic scaling:

The formula follows directly from logarithmic properties of positional numeral systems. Since

the number of digits of a positive integer x in base b is given by

Substituting  yields the stated expression, which shows that digit length grows linearly in  with slope . The output of this function was compared to empirical results to ensure consistency across all  .

In addition to frequency analysis, the observed digit imbalance can be interpreted theoretically through modular periodicity. For any odd base b, the numbers 2 and b are coprime, and thus the sequence of residues  mod b is periodic according to Euler’s theorem. This periodicity influences the least significant digits of the representation and may extend to higher positions through carry propagation in positional notation. Consequently, digit distributions are not expected to be perfectly random. Instead, they reflect deterministic arithmetic constraints imposed by the numeral system, which helps explain the increasing bias toward smaller digits in larger odd bases.

Digit Frequency and Entropy Evaluation

In addition to length, we analyze how often each digit occurs across all powers for each base. For example, base 5 uses digits {0–4}, and we count the total number of times each appears in the expansion of  for all . This produces a full-digit distribution vector per base. To quantify the randomness or skew of these distributions, we compute Shannon entropy:

where  is the normalized frequency of digit . Entropy measures the degree of uniformity in the digit distribution: higher entropy indicates more balanced digit usage, while lower entropy reflects structural bias. This approach is widely used in symbolic information theory and randomness detection [10]. A completely uniform distribution in base 3, for example, would yield , a benchmark against which we compare our findings.

Frequency analysis and entropy were computed using Python’s ‘collections.Counter‘ for fast counting and ‘math.log2‘ for entropy terms. All results were stored in structured data frames for further analysis and visualization.

Implementation and Scope Justification

All code was written in Python 3.11. Libraries used include ‘math‘ for logarithmic operations, ‘pandas‘ and ‘numpy‘ for data structuring, and ‘matplotlib‘/‘seaborn‘ for visualization. Outputs include base-b representations, digit length arrays, entropy scores, and frequency bar charts. The decision to use  to 100 balances analytical depth with numerical stability. This range aligns with previous research such as Aliyev’s work on ternary expansions [6] and Spiegelhofer’s study of digit sums [7], both of which use similar scales. Our deterministic dataset also simplifies replication and eliminates randomness from the experimental design.

The range 1 ≤ n ≤ 100 was selected to balance computational feasibility and analytical clarity. This interval is sufficient to capture both early-stage behavior and emerging structural patterns in digit length, distribution, and entropy. Prior studies on digit properties of exponential sequences have shown that key regularities become observable within relatively small ranges of n. Therefore, extending the range further is not expected to qualitatively change the observed trends, but rather to reinforce them. Moreover, the deterministic nature of the sequence 2^n ensures that increasing n primarily scales the data without introducing fundamentally new structural phenomena.

Modeling Assumptions and Theoretical Rationale

Our model assumes that digit structures in each base follow pure positional weighting, without rounding or floating-point distortion. Since all numbers are integers, we work entirely with exact values. The only base-specific behavior arises from how digits are grouped in each positional system. We also assume that  behaves similarly across representations for small vs. large  in terms of structural complexity. This is supported by previous research on digit growth and entropy in exponential sequences [7], [9]. Holding the input fixed (powers of 2) across varying bases lets us isolate the radix effect clearly. This focus reflects theoretical questions raised by Knuth and Feder about base-induced behavior in algorithmic and cognitive settings [1], [4].

Results and discussions

This section presents the digit structure of from n = 1 to 100 in base 3, 5, and 7. We evaluate digit length growth, frequency distribution, and structural differences across these numeral systems. The data were produced using a custom Python script, and results are shown in tabular and visual formats.

Digit Entropy and Distribution

To evaluate the randomness of digit distributions, we computed Shannon entropy for each base. As shown in Table 1, base 3 has an entropy of approximately 1.58, which is very close to the maximum theoretical entropy . This indicates a near-uniform distribution of digits In contrast, bases 5 and 7 exhibit lower entropy, reflecting increasing bias in digit frequencies.

Although entropy values remain close to their theoretical maxima, the deviation from  increases as the base grows. This suggests that symbolic uniformity weakens in larger odd bases. Thus, the representations of exhibit constrained randomness shaped by base-dependent arithmetic effects

Table 1.

Digit frequencies and Shannon entropy of  for  TO  in bases .

Base

Digit

Frequency

Total Digits

Entropy

3

0

995

3236

1.58

3

1

1120

 

 

3

2

1161

 

 

5

0

397

2226

2.3194

5

1

475

 

 

5

2

460

 

 

5

3

449

 

 

5

4

445

 

 

7

0

230

1849

2.7967

7

1

308

 

 

7

2

302

 

 

7

3

244

 

 

7

4

290

 

 

7

5

248

 

 

7

6

227

 

 

 

Digit Length Growth

Figure 2 shows the digit length of each  in , , and . The growth follows a logarithmic pattern as predicted by the formula

 

Figure 2. Growth of digit length of 2^n in bases 3, 5, and 7 for n = 1 to 100. The results confirm logarithmic scaling of representation length, with smaller bases producing longer digit sequences due to lower radix values.

 

As expected, digit length increases steadily with the exponent . The smallest base (3) yields the longest representations, with length reaching nearly  digits for , while base 7 remains the most compact. This confirms that smaller bases require longer representations to encode the same numerical value.

Digit Frequency Distribution

As illustrated in Figure 3, digit frequencies are relatively balanced in base 3, while higher bases exhibit increasing bias toward smaller digits.

 

Figure 3. Digit frequency distribution of 2^n in bases 3, 5, and 7 for n = 1 to 100. The distributions illustrate increasing bias toward lower digits as the base increases, highlighting structural constraints in positional numeral systems

 

The observed imbalance in digit frequencies, particularly in bases 5 and 7, can be explained by structural properties of positional numeral systems. As the base increases, the spacing between digit thresholds becomes wider, which affects how values are distributed across digit positions. Since powers of two grow exponentially, their representations do not uniformly fill the available digit space in higher bases.

Additionally, the process of carry propagation in positional systems introduces dependencies between adjacent digits. When converting  into a given base, each division step produces remainders that are not independent but are constrained by previous steps. This leads to a systematic preference for lower digits, especially in larger bases where higher digits require more specific numerical conditions to appear.

Furthermore, the periodic nature of  modulo b plays a significant role. Since 2 and any odd base b are coprime, the sequence of residues is periodic. This periodicity governs the least significant digits and influences the overall structure of the representation. As a result, digit sequences exhibit deterministic patterns rather than purely random behavior, which explains why entropy values remain high but do not reach the theoretical maximum.

This suggests that the ternary representation of powers of 2 approximates uniform digit usage over this range. In base 5, the digits 0 and 1 dominate, while digits 3 and 4 occur less frequently. The imbalance becomes more pronounced in base 7, where digits 0, 1, and 2 are significantly more common than 5 or 6. This suggests that higher odd bases introduce a structural bias that leads to underrepresentation of higher digits.

Tabular Representation and Structural Trends

Table 2 presents selected representations of  in bases 3, 5, and 7, along with their corresponding digit lengths. The data confirms that, for small n, base representation is compact across all systems. As n increases, the disparity in digit length becomes more significant. Base 3 quickly outpaces base 5 and 7 in length due to the smaller radix.

Table 2.

Base 3, 5, and 7 representations of   for  selected values of . representations are abbreviated with . . . when exceeding 10 digits.

n

Base 3

Base 5

Base 7

1

2

2

1

2

1

2

1

5

32

1012

4

112

3

44

2

10

1024

1101221

7

13044

5

2662

4

20

1048576

122202…

13

232023301

9

11625034

8

50

1.13

121101…

32

214003…

22

456103…

18

100

1.27

212011…

63

132244…

43

345523…

36

 

These results demonstrate that numeral base plays a significant role in shaping the structural properties of exponential number representations. The observed patterns highlight how positional systems influence symbolic complexity and digit variability.

Conclusion

This study explored how powers of two behave when expressed in non-standard odd-base numeral systems, specifically bases 3, 5, and 7. We analyzed the digit structure of  for 1 ≤ n ≤ 100 by performing base conversion, measuring digit length, evaluating digit frequency distributions, and computing Shannon entropy. The results confirm that digit length grows logarithmically with respect to n, consistent with theoretical expectations. Smaller bases produce longer representations, with base 3 yielding the largest digit lengths due to its lower radix. In contrast, higher bases such as 5 and 7 provide more compact representations. Digit frequency analysis shows that base 3 exhibits a relatively balanced distribution, while bases 5 and 7 display increasing bias toward lower digits. This indicates that higher odd bases introduce structural constraints that reduce digit uniformity. Consequently, the digit sequences of 2^n are not purely random but reflect deterministic properties imposed by the positional numeral system.

These findings contribute to a deeper understanding of how numeral bases influence symbolic representations of exponential sequences. The results also highlight the importance of base selection in shaping digit behavior and entropy characteristics.

While a wider range of n could provide additional confirmation of the observed patterns, the interval 1 ≤ n ≤ 100 is sufficient to capture the fundamental structural properties of digit length, distribution, and entropy. Due to the deterministic nature of the sequence 2^n, extending the range would primarily reinforce the observed trends rather than introduce qualitatively new phenomena.

Future work may extend this analysis to other numeral systems (including even or larger prime bases) and to different numerical sequences such as powers of 3, prime numbers, or Fibonacci numbers. Such extensions could provide further insight into the relationship between number systems, symbolic structure, and information-theoretic properties.

 

References:

  1. D. E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd ed. Addison-Wesley, 1997.
  2. S. Buijsman, “How numerals support new cognitive capacities,” Synthese, vol. 197, pp. 3779–3796, 9 2020.
  3. L. Strickland, Leibniz on Number Systems. Springer International Publishing, 2022, pp. 1–31.
  4. A. Feder, S. Cohen-Gutman, M. Lozin, and M. Pinhas, “Place-value and physical size converge in automatic processing of multi-digit numbers,” Memory and Cognition, vol. 52, pp. 1001–1016, 7 2024.
  5. M. S. Moghadam, S. Aygun, M. R. Alam, and M. H. Najafi, “P2lsg: Powers-of-2 low-discrepancy sequence generator for stochastic computing,” in Proceedings of the Asia and South Pacific Design Automation Conference, ASP-DAC. Institute of Electrical and Electronics Engineers Inc., 2024, pp. 38–45.
  6. Y. N. Aliyev, “Digits of powers of 2 in ternary numeral system,” Notes on Number Theory and Discrete Mathematics, vol. 29, pp. 474–485, 9 2023. [Online]. Available: https://nntdm.net/volume-29-2023/number-3/ 474-485/
  7. L. Spiegelhofer, “Collisions of digit sums in bases 2 and 3,” Israel Journal of Mathematics, vol. 258, pp. 475–502, 12 2023.
  8. D. L. Kreher and D. R. Stinson, “On min-base palindromic representations of powers of 2,” 1 2024. [Online]. Available: http://arxiv.org/abs/2401.07351
  9. Z. Masakova and E. Pelantova, “Periodicity and pure periodicity in ´ alternate base systems,” Research in Number Theory, vol. 10, 9 2024.
  10. A. Elmasry and J. Katajainen, “Regular numeral systems for data structures,” Acta Informatica, vol. 59, pp. 245–281, 6 2022.
Информация об авторах

Student, School of Information Technology and Engineering, Kazakh-British Technical University, Kazakhstan, Almaty

студент, Школа Информационных технологий и Инженерии, Казахстанско-Британский технический университет, Казахстан, г. Алматы

PhD, Associate Professor of Mathematics, School of IT and Engineering at ADA University, Azerbaijan, Baku

PhD, доц. кафедры математики, Школы информационных технологий и инженерии Университета ADA, Азербайджан, г. Баку

Журнал зарегистрирован Федеральной службой по надзору в сфере связи, информационных технологий и массовых коммуникаций (Роскомнадзор), регистрационный номер ЭЛ №ФС77-54434 от 17.06.2013
Учредитель журнала - ООО «МЦНО»
Главный редактор - Звездина Марина Юрьевна.
Top