Next Article in Journal
Recursive Queried Frequent Patterns Algorithm: Determining Frequent Pattern Sets from Database
Previous Article in Journal
Feasibility Evaluation of Secure Offline Large Language Models with Retrieval-Augmented Generation for CPU-Only Inference
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Approach to the Collatz Conjecture with Petri Nets

1
Independent Researcher, 1607 Palézieux, Switzerland
2
Institute of Automatic Control, Electronics and Electrical Engineering, University of Zielona Góra, 65-516 Zielona Góra, Poland
*
Author to whom correspondence should be addressed.
Information 2025, 16(9), 745; https://doi.org/10.3390/info16090745
Submission received: 31 July 2025 / Revised: 21 August 2025 / Accepted: 26 August 2025 / Published: 28 August 2025
(This article belongs to the Special Issue Intelligent Information Technology, 2nd Edition)

Abstract

The Collatz conjecture is a famous unsolved problem in mathematics, known for its deceptively simple rules that generate complex, unpredictable behaviour. It can be efficiently modelled using a Petri net that represents its inverse graph, where each place corresponds to an integer and each transition encodes an inverse rule. The net, constructed up to a bound n, reveals the tree-like structure of predecessors and highlights properties such as recurrence, reachability, and liveness. Token flows simulate possible trajectories towards 1. This formal approach enables the investigation of the problem through discrete event systems theory and opens perspectives for parametric or inductive extensions beyond the bounded domain. The model proposed provides a structured framework for visualising and analysing the inverse dynamics of the conjecture. Some key numerical results highlight the challenges of working within a finite domain: for n max = 1000 , the constructed Petri net comprises 1000 places and 667 transitions, including 417 source nodes (no predecessors), 333 sink nodes (no successors), and 218 isolated orphans, i.e., nodes only reachable via Div 2 transitions with no incoming 3 n + 1 edge.

Graphical Abstract

1. Introduction

The Collatz conjecture [1] is a well-known mathematical problem, also referred to as the “Syracuse conjecture” [2] or the “3x + 1 problem” [3]. It defines a deceptively simple arithmetic process whose dynamics remain surprisingly complex and unpredictable. It can be described briefly as follows: (1) take a positive integer; (2) if it is even, divide it by 2; if it is odd, multiply it by 3 and add 1; (3) repeat step 2. What makes the conjecture particularly intriguing is the fact that, despite its deterministic nature, it exhibits behaviour resembling pseudo-randomness. Additionally, it is assumed that for any integer, it will eventually reach the value 1. Although extensively verified numerically, a general proof remains elusive and continues to attract considerable research attention [4,5,6,7]. Beyond its mathematical interest, the Collatz process has found practical applications in several domains, including cryptography [8] (increasingly important even in the case of Smart Grid security [9]), image encryption [10] (for cryptography algorithms with low memory consumption [11]), the generation of pseudo-random numbers [12], and medicine, supporting schizophrenia detection [13].
Unlike standard numerical approaches, a Petri net framework enables explicit tracking of state transitions, concurrency, and structure [14], making it well suited for exploring the recursive and branching nature of the Collatz dynamics. Petri nets [15] offer a graphical and mathematically precise way to model, analyse, and verify event-driven systems. They have so far proved to be useful in many application areas, including business process management [16], cyber–physical systems [17], freight logistics and transportation systems [18], space systems [19], healthcare systems [20], manufacturing systems [21], power systems [22], and reliability and safety engineering in general  [23]. Their graphical representation includes only four elements (places, transitions, arcs, and tokens), while allowing for the specification of complex behaviour.
In this paper, a Petri net-based model of the Collatz dynamics is proposed. Transitions naturally encode the recursive rules of the sequence, while places correspond to integer values. This model not only captures the operational semantics of the process but also potentially enables additional features, like parallel simulation of multiple Collatz trajectories. Moreover, Petri net theory provides analytical techniques such as invariants, boundedness, reachability, and liveness, which can be leveraged to study the global behaviour of the system. The net then becomes a platform not only for visualising trajectories but also for generalising or altering the dynamics in a controlled, formalised setting. Importantly, instead of modelling the Collatz conjecture in a standard forward direction, starting from the chosen integer, an inverse approach that explores all possible predecessors of 1 is proposed. This perspective allows the construction of a branching structure of potential paths converging to 1, revealing the underlying structure of the conjecture in a novel, formalised and accessible way.
It should be emphasised that the present work adopts an inverse modelling perspective: rather than iterating the Collatz function forward from a chosen integer to follow its trajectory, the Petri net is constructed starting from the root P 1 and expanding all possible predecessors under the inverse rules.
This approach contrasts with “forward” modelling, where the state space is generated by successive forward iterations n n / 2 or n 3 n + 1 . While the forward viewpoint produces a single deterministic path for each initial value, the inverse construction yields a branching structure that simultaneously encodes all possible trajectories converging to  P 1 . Existing studies have modelled the Collatz process using directed graphs [24,25] or automata [26,27], including both forward and inverse variants. In particular, inverse Collatz trees have been analysed for their binary representation patterns and algebraic properties. However, to the best of our knowledge, Petri nets have not previously been used to model the Collatz conjecture in either direction.
The present work is therefore original in (i) introducing Petri net semantics to the known Collatz problem, (ii) focusing on the inverse formulation, and (iii) leveraging Petri net analysis techniques (reachability, liveness, and invariants) to investigate its structural properties.
As far as we are aware, this is the first approach that applies Petri nets to model the Collatz conjecture, especially from the inverse perspective. The novel contribution of the paper can be summarised as follows:
  • A formal Petri net construction is proposed that encodes inverse Collatz dynamics;
  • A graphical visualisation of the branching structure converging to 1 is shown;
  • An exploratory framework for analysing reachability and structural properties (boundedness and liveness) in the Collatz process is proposed.
The rest of the article is organised as follows. Section 2 presents some related work on and the basic theory of Petri nets. Section 3 presents the modelling idea. Section 4 introduces a novel inverse approach to Collatz conjecture with Petri nets. Section 5 discusses and analyses the results. Finally, Section 6 concludes the paper and outlines directions for future work.

2. Theory Background

2.1. Related Work

Let us first present the related work regarding the Collatz conjecture and its visualisations.
Definition 1
(Collatz Conjecture). Let T : N N be the function defined by
T ( n ) = n 2 , if n is even , 3 n + 1 , if n is odd .
The Collatz conjecture [28] states that for every n N , there exists k N such that
T ( k ) ( n ) = 1 ,
where T ( k ) denotes the k-fold composition of T.
To better understand the structure of the Collatz conjecture, several researchers have proposed and analysed diverse forms of its visualisation. A common graphical form is a directed graph or a tree showing changing values [29]. Nodes represent integers, and directed edges correspond to transitions dictated by the Collatz rules. In the standard Collatz graph, each node is connected to the next value in the sequence, thus producing a deterministic path from any starting value. In contrast, the inverse Collatz tree begins at the root node 1 and explores all possible predecessor values that could lead to it using inverse operations. This approach highlights the branching structure and reveals how values converge towards 1. Such visualisations help researchers observe patterns, identify potential cycles or regularities, and examine the density or sparsity of trajectories. For example, Stérin [24] developed an inverse Collatz graph rooted at 1 and analysed structural properties through binary representations. Diedrich’s preprint [30] proposes an algebraic notion of inverse trees aimed at characterising the structure of predecessors of 1. Olgac [25] defined a deterministic inverse–Collatz tree on odd integers via two modular edge-generating functions, demonstrating surjectivity and establishing a complete ancestral structure rooted at 1. This work lends algorithmic credibility to inverse-domain modelling, analogous to but distinct from the Petri net framework. More generally, the incremental construction of directed acyclic graphs has been formalised by Olgac in a separate work on graph topology and structure [31]. His approach provides foundational insights into how branching structures evolve while preserving global connectivity—a perspective relevant to the recursive expansion of inverse Collatz trees.
Emmert-Streib [32] investigated the state-space network formed by Collatz iterations, while exploring connectivity, node types, and complexity measures in a graph-theoretic context. Andaloro [33] used directed graph models and their implications, introducing the notion of a weakly connected graph. Laarhoven and de Weger [34] connected Collatz iteration dynamics to binary De Bruijn graph theory, introducing novel structured representations of the orbits. Andrei et al. [3] formulated a notion of “chain subtrees” in the Collatz tree, providing new theoretical insights.
The graph-based approaches are complemented by automata, as proposed by Ren and Xiao in [26], or cellular automata, as shown by Kari in [27]. Automata turned out to be suitable for modelling individual Collatz trajectories, especially considering state-based insights.
A recent contribution by Owada [35] proposed a structural interpretation of the Collatz conjecture using tree representations. While his approach is not based on Petri nets, it shares the objective of unveiling the underlying dynamics and branching behaviours of the inverse Collatz process.
Kosobutskyy and Rebot [36] examined the inverse Collatz dynamics through the lens of Newtonian binomial forms, highlighting the emergence of distinct inverse cycles and lower-bound oscillations. Their formulation—marked by explicit algebraic constraints—reinforces the relevance of inverse-domain analysis, while differing from our Petri net implementation in its algebraic rather than structural modelling approach.
In contrast, Petri nets provide a more expressive framework for modelling and allow the exploration of the system as a whole and the simulation of multiple paths simultaneously, with strong support for formal verification. Petri nets enable a higher-level abstraction that facilitates not only visualisation but also formal verification of complex dynamics. For these reasons, the Petri net formalism is particularly well suited for investigating the inverse and structural properties of the Collatz graph.

2.2. Petri Nets

Several preliminary concepts from the Petri net theory are introduced to enhance clarity and readability (the definitions are mainly based on [37,38]).
Definition 2
(Petri net). A Petri net can be defined as a four-tuple P N = ( P , T , F , M 0 ) , where P is a finite set of places (drawn as circles), T is a finite set of transitions (visually, bars), F ( P × T ) ( T × P ) is a finite set of arcs (arrows), and M 0 is an initial marking (a token is represented by a dot).
In a Petri net, places may be connected via arcs only with transitions and vice versa. However, it is possible to model various behaviours, like choice or concurrency, by using the appropriate net structure [39].
A markinginvolves all places that contain a token. A transition is said to be enabled if each of its input places contain a token. A transition can be fired if it is enabled. Then, a token is removed from all its input places and added to all its output places. A marking is reachable from any other marking if it can be reached by a sequence of transition firings.
Definition 3
(Liveness). A Petri net is l i v e if, from any reachable marking, it is always possible to fire any transition, whether directly or indirectly, by a sequence of firings of other transitions.
Definition 4
(Safeness). A Petri net is s a f e if there is no reachable marking such that any place contains more than one token.
It is possible to add some guards to the net structure in order to model choice. They are then assigned to transitions. Furthermore, if referring to the Mealy automaton, some actions can also be assigned to transitions and are then executed when a transition is fired. A sample Petri net with choice is shown in Figure 1. The guards are written in green font, while the actions are written in red font. The structure is based on three places and four transitions. The initial marking involves place p 1 . In the case of detected sun (guard sun = 1), transition t 1 is fired, the lamp is turned off (action lamp := 0), and place p 2 becomes active. After some specified timeout, transition t 3 is fired, and the initial marking is reached again. If there is not enough sun (guard sun = 0), transition t 2 is fired, the lamp is turned on (action lamp := 1), and place p 3 becomes active. After the timeout, transition t 4 is fired, returning to the initial marking. The net is live and safe.

2.3. Suitability of Petri Nets for Modelling the Collatz Conjecture

While Petri nets are widely applied in system analysis, their adequacy for number-theoretic problems such as the Collatz conjecture deserves clarification. The following points highlight structural and conceptual reasons why Petri nets provide a natural framework for this modelling task.
  • Natural encoding of rules: Petri nets map integer states to places and iteration rules to transitions, preserving the logical structure of the Collatz process.
  • Petri nets offer both graphical insights (branching structure and depth) and algebraic tools (with formal verification methods) that can be exploited for structural reasoning.
  • Reachability-based reformulation—the conjecture becomes a reachability property: place P 1 is reachable from any P n , enabling the use of established Petri net reachability theory.
  • Reformulation of the conjecture: T-invariant study.
  • Parametric generalisation (an + b) allowing comparative structural analysis.
  • Extending the study by reformulating the Collatz problem in Petri net terms creates a bridge between number theory, system modelling, and computer science, thereby broadening its interdisciplinary relevance.
  • Petri nets are, by construction, bipartite directed graphs where places and transitions alternate. This structure aligns closely with directed graph representations of the Collatz problem, such as those explored by Olgac [31], while adding formal semantics for token flow, concurrency, and state change. This dual nature allows the Petri net to inherit the visual clarity of graph-based models while enabling algebraic analysis through incidence matrices and invariants.

3. Inverse Collatz Modelling in the Petri Net Framework

3.1. Modelling Principle

The main modelling principle can be sketched as follows. Starting from the integer 1, the inverse Collatz structure is constructed by recursively applying the inverse rules of the standard process. For each integer n, all valid predecessors, i.e., integers m such that either n = m / 2 or n = ( 3 m + 1 ) / 2 k for some k N , are computed and linked to n through directed edges. This inverted representation yields a branching graph rooted at 1, capturing all possible paths that could lead to it under the Collatz dynamics. A schematic view of this construction is shown in Figure 2.
Within the Petri net formalism, such a structure is naturally interpreted, with transitions representing backwards computational steps and places corresponding to integer states. This approach enables the representation of multiple trajectories in parallel, as well as explicit modelling of branching and convergence. However, when restricted to a finite domain [ 1 , n ] , the construction exhibits structural limitations: several valid predecessors fall outside the considered interval, resulting in an incomplete or disconnected graph. These limitations are further discussed in Section 5.
To formalise the generation process, the method for building the Petri net is summarised in the pseudo-code Algorithm 1. The procedure is independent of the development tool and directly follows the two inverse rules described above: the even branch ( 2 n n ) and the odd branch ( n 1 3 n when valid). It ensures that each integer within the bounded domain is represented by a unique place and that each valid inverse step is represented by a dedicated transition. This formalisation provides a clear mapping from the mathematical definition of the inverse Collatz graph to a Petri net structure, facilitating subsequent analysis of reachability, liveness, and invariants.
Algorithm 1 Build Inverse Collatz Petri Net
( n max )
1:
P , T , F
2:
Create places P n for n = 1 n max
3:
M 0 { ( P n max , 1 ) } {Initial marking after place creation}
4:
for  n = 1 to n max  do
5:
   if  2 n n max  then
6:
     Create transition t n ( 2 ) : P 2 n P n
7:
     Add arcs ( P 2 n , t n ( 2 ) ) and ( t n ( 2 ) , P n )
8:
   end if
9:
   if  ( n 1 ) mod 3 = 0  then
10:
      p ( n 1 ) / 3
11:
     if  1 p n max and p odd then
12:
        Create transition t n ( 3 ) : P p P n
13:
        Add arcs ( P p , t n ( 3 ) ) and ( t n ( 3 ) , P n )
14:
     end if
15:
   end if
16:
end for
17:
return  N = ( P , T , F , M 0 )
Algorithm 1 starts by initialising empty sets for places P, transitions T, and arcs F (line 1). The procedure then creates one place P n for each integer n in the bounded domain (line 2) and sets the initial marking M 0 (line 3), here with one token at P n max as an example (line 3). The main loop (lines 4–16) iterates over all n to identify valid inverse predecessors. For the even branch, 2 n is connected to n through a transition t n ( 2 ) if 2 n lies within the domain (lines 5–7). For the odd branch, ( n 1 ) / 3 is connected to n through t n ( 3 ) only when ( n 1 ) is divisible by 3, the predecessor p is odd, and p is within the domain (lines 9–13). Each valid branch results in the creation of a transition and the corresponding arcs, ensuring a faithful Petri net representation of the inverse Collatz graph. Finally, line 17 returns the Petri net N .

3.2. Computational Complexity and Feasibility

The construction algorithm runs in linear time and space with respect to the upper bound n max . It generates exactly n max places and approximately 2 3 n max transitions. The space usage is dominated by the storage of places and transitions.
The initial algorithm in Python (version 3.11.4) has been slightly modified, adding performance assessment: time.perf_counter for timing and tracemalloc for peak memory usage. Table 1 reports the results for increasing bounds n max . For example, the case n max = 500 , 000 was built in 1.54  s with a peak memory of 65 MB, confirming the linear growth and showing that large-scale experiments (up to millions of nodes) remain feasible on standard hardware.
Exporting the entire structure in DOT format is practical only for moderate n max , as file size and rendering overhead quickly become prohibitive.

4. The Proposed Inverse Approach with Petri Nets

4.1. Construction of the Inverse Collatz Petri Net

The inverse Collatz Petri net can be constructed algorithmically using a recursive rule set applied to each integer in a bounded domain. It is based on a simple rule set applied iteratively for each integer i [ 1 , n ] :
  • For each integer i, create a place P i (unless it already exists).
  • If i is even:
    -
    Create the place P i / 2 if it does not exist.
    -
    Add a transition labeled Div2 from P i / 2 to P i .
  • If ( i 1 ) mod 3 = 0 and ( i 1 ) / 3 is an odd integer:
    -
    Create the place P ( i 1 ) / 3 if it does not exist.
    -
    Add a transition labeled 3n + 1 from P ( i 1 ) / 3 to P i .
The implementation of this algorithm in Python is based on the Snakes Petri net library combined with Graphviz for visualisation.
This process results in a Petri net graph rooted at P 1 , where each node corresponds to an integer.

4.2. Visualisation of the Inverse Collatz Petri Net (Up to n = 127 )

The inverse Collatz graph up to n = 127 is presented in Figure 3. Each node P n corresponds to an integer n, and edges represent valid inverse transitions under the Collatz function. Two types of transitions are distinguished: Div2 in blue ( n 2 n ) and 3n + 1 in red ( n ( n 1 ) / 3 when applicable and when the result is odd).
A set of nodes (framed at the bottom left) forms the group of isolated orphans, i.e., nodes that are only accessible via Div2 transitions and have no incoming 3n + 1 edge. This subset illustrates a key asymmetry in the inverse Collatz structure: many odd integers do not allow a valid ( n 1 ) / 3 backwards transition and remain structurally “linear”.

4.3. Reordering the Graph by Transition Types

The inverse Collatz Petri net presented earlier can be reorganised according to the number and type of transitions leading to each node. In particular, this layout emphasises the distinction between nodes reached through binary divisions (Div2, in blue) and those additionally reached through inverse 3n + 1 transitions (in red). An example of such a reordering can be seen in Figure 4 (with the current marking in place P 13 ). The obtained Petri net is safe (only one token in any place at any time), and thus it is also bounded. It is live, as it is always possible to fire any transition (either directly or via a firing sequence). Moreover, the net is conservative—tokens are neither created nor destroyed—they only move between places, inevitably leading to place P 1 .
The visual separation induced by the reordering suggests a natural stratification of the integers based on their inverse Collatz reachability properties. Such a layout may facilitate further investigations into path depth, entry multiplicity, or recurrence properties, especially when extended to larger domains.

4.4. Limitations of the Petri Net-Based Inverse Construction

When restricted to a finite interval, the inverse Collatz graph suffers from an inherent incompleteness. Although all successors of integers up to a given bound (e.g., n 1000 ) can be listed, their valid predecessors often lie beyond this bound and are therefore excluded from the model. As a consequence, many places in the Petri net appear isolated or without incoming transitions, not due to the structure of the Collatz process itself but as an artefact of the truncation. This limitation affects the coherence of the net and hinders the reliable analysis of reachability or global behaviour within the inverse framework.
Furthermore, demonstrating the conjecture is impossible on a finite domain. Although the inverse Collatz Petri net has been elaborated to be acyclic within the considered bounded domain, a formal proof of acyclicity for the unbounded case is not provided here. Likewise, convergence towards P 1 is only supported by empirical inspection of the generated graphs and remains unproven in general. Rigorous arguments, for example through induction over the net’s recursive construction rules or structural invariants in an infinite-state setting, are recommended for future work.

4.5. Description of Used Tools

The modelling and visualisation work was conducted in a local Python 3.x environment using a custom Petri net construction strategy. The network was built programmatically with the Snakes library (v0.9.33), a formal and extensible framework for Petri net modelling in Python [40]. Due to plugin limitations in precompiled versions, the model was exported in DOT format and visualised using Graphviz (dot CLI tool) to produce high-quality PNG and SVG renderings. This fully open-source toolchain ensured complete control over the network generation and guaranteed platform independence and reproducibility of the results.

5. Discussion

5.1. Reformulating the Collatz Conjecture in Petri Nets Terms

The classical Collatz conjecture asserts that every positive integer will eventually reach the value 1 under the repeated application of the function:
n n 2 if n 0 mod 2 3 n + 1 if n 1 mod 2
In the Petri net framework, the inverse process is considered: for each number n, the possible predecessors are identified under the Collatz mapping and encoded as transitions leading to p n . The resulting inverse graph is modelled as a Petri net, where tokens represent possible computational paths.
Under this interpretation, the conjecture can be reformulated as a dynamic property of the net:
For any place P n , the place P 1 is reachable via a finite sequence of transition firings.
In other words, starting from any initial marking with one token in P n , the token will eventually reach P 1 . This makes the conjecture equivalent to the global reachability of P 1 , making Petri net analysis tools a possible formal framework to study its structure and behaviour.

5.2. Structural Properties: Reachability and Liveness

Beyond visualisation, the Petri net representation enables the investigation of structural properties inherent to the Collatz process.
Reachabilityis central to the conjecture: the assertion that every integer eventually reaches 1 translates naturally to the requirement that the place P 1 is reachable from any initial marking P n . In this model, verifying that a token placed in P n can reach P 1 corresponds to confirming the conjecture for that value. Reachability analysis thus becomes a formal interpretation of convergence.
Liveness, in the classical Petri net sense, refers to the ability to fire any transition eventually, from any reachable marking. Since the inverse Collatz net is acyclic and bounded to a finite domain, global liveness does not apply: each token inevitably reaches a terminal node or the domain boundary. However, local liveness can still be evaluated, especially to detect structurally inactive transitions caused by truncation or unreachable predecessors. Such analysis may help identify dead zones in the graph and suggest refinements in the generation strategy or bounding heuristics.

5.3. Interpretation of Apparent Ascending Paths

The inverse construction used in the Petri net model involves transitions from predecessors m to successors n, where f ( m ) = n . As a result, the direction of arcs in the graph goes from larger integers to smaller ones. This can lead to the impression of upward movement when interpreting the graph numerically.
Figure 4 illustrates this apparent paradox: the node P 16 , part of the binary “spine”, receives a 3n + 1 transition from P 5 , and P 5 itself is reached via a Div2 from P 10 . While the numerical values increase (10 → 5 → 16), the token progresses downward through the graph structure towards P 1 . This confirms that despite the numerical rise, the graph remains acyclic and structurally oriented towards the root. The propagation of tokens consistently follows a descending logical path, which is crucial for ensuring the absence of cycles and deadlocks in the Petri net representation.

5.4. A Structural Reordering of the Integers

It can be observed in Figure 4 that the inverse Collatz Petri net implicitly defines a reordering of the integers. Instead of being arranged by their numerical value, places are connected based on their functional ancestry under the inverse Collatz rules. This leads to a topology in which higher-valued integers may appear “before” smaller ones when considered from the perspective of token propagation towards P 1 .
Such a structure reorders the integers by their topological distance to the root, measured not in arithmetic terms but in the number of transition firings required to reach P 1 . As a result, the Petri net encodes a form of structural hierarchy reflecting the computational flow of the conjecture, rather than a simple numerical sequence.

5.5. Structure Induced by Inverse Collatz Dynamics

The inverse construction of the Collatz graph, when modelled as a Petri net, gives rise to a non-trivial structural organisation of the integers. Unlike the natural ordering 1 < 2 < 3 < 4 < , the net creates a hierarchy defined by the directed arcs between places, which correspond to valid inverse transitions.
This results in a functional reordering of the integers, where the relative “priority” of a number is determined by its position within the inverse dependency tree. Tokens propagating through the net follow these arcs, ultimately converging towards P 1 . The number of transitions required to reach P 1 from a given place P n can be interpreted as a structural depth or distance to the root, reflecting the complexity of the inverse trajectory rather than the magnitude of n.

5.6. Analysis of T-Invariants and P-Invariants

In Petri net theory, a P-invariant (place invariant) is an integer-valued vector over the set of places that satisfies y T · C = 0 , where C is the incidence matrix of the net. Such a vector identifies a linear combination of places whose total number of tokens is preserved for all possible transition firings. Place invariants are often used for Petri net decomposition, aimed at splitting the control algorithm into sequential subsystems, where each of the decomposed modules can be implemented separately [41]. A T-invariant (transition invariant) is an integer-valued vector over the set of transitions that satisfies C · x = 0 . It corresponds to a multiset of transitions whose firing sequence returns the net to its original marking. T-invariants are often used to analyse crucial properties of the net, such as liveness or boundedness [42].
Let us now consider possible P-invariants for the Collatz conjecture modelled with Petri nets, which indicate linear combinations of places where the total number of tokens is preserved for all possible transitions. The achieved Petri net models are essentially chain-like structures, showing the inverse Collatz steps, with some branching (various starting points as possible initial markings), but neither token creation nor destruction. Therefore, each connected sequence of places and transitions conserves the token count.
Coming to the T-invariants, they usually mean multisets of transitions that return the net to its original marking. As the obtained Petri net models are acyclic, non-trivial T-invariants do not exist there. There is no possibility of returning to the initial marking, as firing any sequence of transitions strictly moves tokens forward with no way to go back. In the unbounded case, the absence of non-trivial T-invariants would be equivalent to the absence of non-trivial cycles in the Collatz dynamics, which in turn would constitute a proof of the conjecture.     

6. Conclusions

The Petri net modelling of the inverse Collatz process offers an interesting reformulation of the conjecture. By translating arithmetic rules into transitions and integer states into places, this framework reveals an uncommon architecture of the problem. Beyond visualisation, the net structure introduces a new topological ordering of the integers, where reachability, transition types, and structural depth replace conventional arithmetic hierarchy. This reformulation opens new perspectives for analysing the conjecture through symbolic, inductive, or recurrence-based methods. This paper shows how the Petri net formalism can be used to model the Collatz conjecture in order to benefit from the advantages of formal specification techniques.
The truncation imposed by the Petri net makes the conjecture impossible to fully demonstrate. This observation motivates further research into dynamic or symbolic approaches capable of transcending strict enumeration. Future works may include, but are not limited to the following:
  • Inductive reasoning over the Petri net structure. Instead of reasoning on individual trajectories, it may be possible to attempt structural induction over the net itself. For instance, proving that if all immediate predecessors of a place P n lead to P 1 , then P n does as well. Such a recursive propagation of reachability could, in principle, generalise the conjecture beyond finite bounds.
  • Recurrence-based formalisms. The Collatz process lends itself to recursive formulations of stopping times or path lengths. In the inverse Petri net, it may be possible to model the depth D ( n ) of a place as a function of the depths of its predecessors, enabling symbolic analysis of convergence or complexity.
  • Parametrised generalisations of the transition rules. By extending the transition set beyond the standard n n / 2 and n 3 n + 1 , it becomes possible to study a wider class of integer mappings. A parametrised Petri net could capture variations such as a n + b rules, offering a comparative view and potentially tractable analogues of the original conjecture.
  • Ordering the integers based on transition sequences. The topological structure of the Petri net defines a new partial ordering of the integers, no longer based on magnitude but on their functional ancestry within the graph. Future work could explore this ordering formally, for example by defining a “transition-depth” metric that weights red and blue transitions differently (e.g., assigning greater cost to 3n+1 arcs). This would provide a transition-aware hierarchy of integers, potentially revealing new stratifications of complexity or path redundancy across the net.
  • Studying transition-induced depth metrics. Building on the above, one could define for each place P n a vector ( d b , d r ) representing the number of blue and red transitions required to reach P 1 . This bi-dimensional metric may help detect families of integers with similar structural positions and perhaps inform conjectural bounds on stopping times or convergence rates.
As a case study, let us consider the formulation of the Collatz conjecture in terms of T-invariants. In the Petri net representation, a non-trivial T-invariant corresponds to a sequence of transitions returning the marking to its initial configuration without reducing to the trivial 1→4→2→1→4→2→1 cycle. Detecting the absence of such invariants in the infinite net would be equivalent to proving the conjecture. While exhaustive computation is only feasible for bounded domains, structural analysis of the truncated net reveals no non-trivial invariants, suggesting a possible inductive strategy: if every local sub-net beyond a certain depth remains acyclic, the property could be propagated upwards to cover the entire infinite structure. This highlights the potential of Petri net theory not only as a visualisation tool but as a formal framework for reasoning about one of mathematics’ most famous unsolved problems.
While the full resolution of the Collatz problem remains out of reach, this approach has proved both insightful and methodologically fruitful. It demonstrates how discrete dynamic systems—such as Petri nets—can be used not merely to simulate behaviour but also to restructure and reinterpret longstanding mathematical questions.

Author Contributions

Conceptualisation, D.M. and I.G.; methodology, D.M.; software, D.M.; investigation, D.M. and I.G.; writing—original draft preparation, D.M. and I.G.; writing—review and editing, D.M. and I.G.; visualisation, D.M.; supervision, I.G.; project administration, I.G.; funding acquisition, I.G. All authors have read and agreed to the published version of the manuscript.

Funding

This work was partially supported by a program of the Polish Ministry of Science under the title ‘Regional Excellence Initiative’, project no. RID/SP/0050/2024/1.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Lagarias, J.C. The Ultimate Challenge: The 3x + 1 Problem; American Mathematical Society: Providence, RI, USA, 2023. [Google Scholar]
  2. Allouche, J.P. T. Tao and the Syracuse conjecture. Eur. Math. Soc. Mag. 2022, 123, 12–16. [Google Scholar] [CrossRef]
  3. Andrei, Ş.; Masalagiu, C. About the Collatz conjecture. Acta Inform. 1998, 35, 167–179. [Google Scholar] [CrossRef]
  4. Ren, W. A new approach on proving Collatz conjecture. J. Math. 2019, 2019, 6129836. [Google Scholar] [CrossRef]
  5. Furuta, M. Proof of Collatz conjecture using division sequence. Adv. Pure Math. 2022, 12, 96–108. [Google Scholar] [CrossRef]
  6. Chen, C. Proof of the Collatz Conjecture. Acad. J. Math. Sci. 2025, 6, 27–44. [Google Scholar] [CrossRef]
  7. Getachew, E.S.; Assefa, B.G. Efficient Computation of Collatz Sequence Stopping Times: A Novel Algorithmic Approach. IEEE Access 2025, 13, 41210–41220. [Google Scholar] [CrossRef]
  8. Al-Hyari, A.; Obimbo, C.; Mua’ad, M.; Al-Taharwa, I. Generating powerful encryption keys for image cryptography with chaotic maps by incorporating collatz conjecture. IEEE Access 2024, 12, 4825–4844. [Google Scholar] [CrossRef]
  9. Alomari, M.A.; Al-Andoli, M.N.; Ghaleb, M.; Thabit, R.; Alkawsi, G.; Alsayaydeh, J.A.J.; Gaid, A.S.A. Security of Smart Grid: Cybersecurity Issues, Potential Cyberattacks, Major Incidents, and Future Directions. Energies 2025, 18, 141. [Google Scholar] [CrossRef]
  10. Ballesteros, D.M.; Peña, J.; Renza, D. A novel image encryption scheme based on Collatz conjecture. Entropy 2018, 20, 901. [Google Scholar] [CrossRef] [PubMed]
  11. Alshannaq, O.; Baharon, M.R.; Alsayaydeh, J.A.J.; Hammouda, M.B.; Hammouda, K.; Nawafleh, M.M.; Rahman, A. Analysis of the Lowest Memory Consumption (Memory Usage) Through Running Different Cryptography Techniques for Different Types of Images. In Proceedings of the Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2022; Volume 2319, p. 012027. [Google Scholar]
  12. Xu, D.; Tamir, D.E. Pseudo-random number generators based on the Collatz conjecture. Int. J. Inf. Technol. 2019, 11, 453–459. [Google Scholar] [CrossRef]
  13. Baygin, M.; Yaman, O.; Tuncer, T.; Dogan, S.; Barua, P.D.; Acharya, U.R. Automated accurate schizophrenia detection system using Collatz pattern technique with EEG signals. Biomed. Signal Process. Control 2021, 70, 102936. [Google Scholar] [CrossRef]
  14. Schneeweiss, W. Tutorial: Petri nets as a graphical description medium for many reliability scenarios. IEEE Trans. Reliab. 2001, 50, 159–164. [Google Scholar] [CrossRef]
  15. Girault, C.; Valk, R. Petri Nets for Systems Engineering: A Guide to Modeling, Verification, and Applications; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  16. van der Aalst, W.M. Business process management as the “Killer App” for Petri nets. Softw. Syst. Model. 2015, 14, 685–691. [Google Scholar] [CrossRef]
  17. Grobelna, I.; Wiśniewski, R.; Wojnakowski, M. Specification of Cyber-Physical Systems with the Application of Interpreted Nets. In Proceedings of the IECON 2019–45th Annual Conference of the IEEE Industrial Electronics Society, Lisbon, Portugal, 14–17 October 2019; Volume 1, pp. 5887–5891. [Google Scholar] [CrossRef]
  18. Cavone, G.; Dotoli, M.; Seatzu, C. A survey on Petri net models for freight logistics and transportation systems. IEEE Trans. Intell. Transp. Syst. 2017, 19, 1795–1813. [Google Scholar] [CrossRef]
  19. Juan, M.; Mailland, D.; Fifis, N.; Gregoris, G. Active Antenna Failure Modeling and Architecture Modifications. Techniques de l’Ingenieur. 2021. Available online: http://dx.doi.org/10.51257/a-v1-se1221 (accessed on 10 December 2021).
  20. Zeinalnezhad, M.; Chofreh, A.G.; Goni, F.A.; Klemeš, J.J.; Sari, E. Simulation and Improvement of Patients’ Workflow in Heart Clinics during COVID-19 Pandemic Using Timed Coloured Petri Nets. Int. J. Environ. Res. Public Health 2020, 17, 8577. [Google Scholar] [CrossRef] [PubMed]
  21. Grobelna, I.; Karatkevich, A. Challenges in Application of Petri Nets in Manufacturing Systems. Electronics 2021, 10, 2305. [Google Scholar] [CrossRef]
  22. Grobelna, I.; Szcześniak, P. Interpreted Petri Nets Applied to Autonomous Components within Electric Power Systems. Appl. Sci. 2022, 12, 4772. [Google Scholar] [CrossRef]
  23. Fischer, K.; Custer, R.; Schubert, M.; Asmolovskiy, N.; Braun, B.; Keil, D.; Faber, M.; Lahorgue, C. New Approaches for Reliability Assessment of Mechanical Systems and Parts (Part 1: Methodology). In Proceedings of the European Safety and Reliability Conference (ESREL), Glasgow, UK, 25–29 September 2016; pp. 2877–2884. [Google Scholar]
  24. Stérin, T. Binary expression of ancestors in the Collatz graph. In Proceedings of the International Conference on Reachability Problems; Springer: Berlin/Heidelberg, Germany, 2020; pp. 115–130. [Google Scholar]
  25. Olgac, E. Proof of the Collatz Conjecture by Constructing the Inverse–Collatz Tree. Preprint 2025. [Google Scholar] [CrossRef]
  26. Ren, W.; Xiao, R. How to Fast Verify Collatz Conjecture by Automata. In Proceedings of the 2019 IEEE 21st International Conference on High Performance Computing and Communications; IEEE 17th International Conference on Smart City; IEEE 5th International Conference on Data Science and Systems (HPCC/SmartCity/DSS), Zhangjiajie, China, 10–12 August 2019; pp. 2720–2729. [Google Scholar] [CrossRef]
  27. Kari, J. Cellular Automata, the Collatz Conjecture and Powers of 3/2. In Proceedings of the Developments in Language Theory: 16th International Conference, DLT 2012, Taipei, Taiwan, 14–17 August 2012; Proceedings 16. Springer: Berlin/Heidelberg, Germany, 2012; pp. 40–49. [Google Scholar]
  28. Gutierrez, A. Collatz conjecture revisited: An elementary generalization. Acta Univ. Sapientiae Math 2020, 12, 112–127. [Google Scholar] [CrossRef]
  29. Wirsching, G.J. Analysis of the Collatz graph. In The Dynamical System Generated by the 3n+ 1 Function; Springer: Berlin/Heidelberg, Germany, 2006; pp. 31–75. [Google Scholar]
  30. Diedrich, E. A Bidirectional Approach to the Collatz Conjecture. Preprints 2025. [CrossRef]
  31. Olgac, E. Topology and Structure of Directed Graphs. Preprint 2024. [Google Scholar] [CrossRef]
  32. Emmert-Streib, F. Structural properties and complexity of a new network class: Collatz step graphs. PLoS ONE 2013, 8, e56461. [Google Scholar] [CrossRef] [PubMed]
  33. Andaloro, P.J. The 3x + 1 problem and directed graphs. Fibonacci Q. 2002, 40, 43–54. [Google Scholar] [CrossRef]
  34. Laarhoven, T.; de Weger, B. The Collatz conjecture and De Bruijn graphs. Indag. Math. 2013, 24, 971–983. [Google Scholar] [CrossRef]
  35. Owada, K. Collatz Trees: A Structural Framework for Understanding the 3x+1 Problem. Preprint 2025. [Google Scholar] [CrossRef]
  36. Kosobutskyy, P.; Rebot, D. Collatz Conjecture 3n ± 1 as a Newton Binomial Problem. Comput. Des. Syst. Theory Pract. 2023, 5, 137–145. [Google Scholar] [CrossRef]
  37. Murata, T. Petri nets: Properties, analysis and applications. Proc. IEEE 1989, 77, 541–580. [Google Scholar] [CrossRef]
  38. David, R.; Alla, H.; David, R.; Alla, H. Discrete, Continuous, and Hybrid Petri Nets; Springer: Berlin/Heidelberg, Germany, 2010. [Google Scholar]
  39. Reisig, W. Petri nets. In Modeling in Systems Biology: The Petri Net Approach; Springer: Berlin/Heidelberg, Germany, 2016; pp. 37–56. [Google Scholar]
  40. Pommereau, F. SNAKES: A Flexible High-Level Petri Nets Library (Tool Paper). In Proceedings of the International Conference on Applications and Theory of Petri Nets and Concurrency, Brussels, Belgium, 21–26 June 2015; Springer: Berlin/Heidelberg, Germany, 2015; pp. 254–265. [Google Scholar]
  41. Wiśniewski, R. Decomposition of Concurrent Control Systems. In Prototyping of Concurrent Control Systems Implemented in FPGA Devices; Springer: Berlin/Heidelberg, Germany, 2016; pp. 77–98. [Google Scholar]
  42. Maliński, M.; Wojnakowski, M.; Wiśniewski, R.; Obuchowicz, A. Transition Invariants in the Analysis of Concurrent Systems Modelled by Petri Nets. In Proceedings of the Technological Innovation for Human-Centric Systems, Caparica, Portugal, 3–5 July 2024; Camarinha-Matos, L.M., Ferrada, F., Eds.; Springer: Cham, Switzerland, 2024; pp. 269–279. [Google Scholar]
Figure 1. Sample Petri net.
Figure 1. Sample Petri net.
Information 16 00745 g001
Figure 2. Flowchart outlining the construction of the inverse Collatz structure.
Figure 2. Flowchart outlining the construction of the inverse Collatz structure.
Information 16 00745 g002
Figure 3. Inverse Collatz graph (structural view) up to n = 127. Red edges represent inverse 3n + 1 transitions, blue edges represent divisions by 2. No explicit Petri net semantics (places/transitions) are shown.
Figure 3. Inverse Collatz graph (structural view) up to n = 127. Red edges represent inverse 3n + 1 transitions, blue edges represent divisions by 2. No explicit Petri net semantics (places/transitions) are shown.
Information 16 00745 g003
Figure 4. An inverse Collatz Petri net model reordered by transition types. Red transitions correspond to inverse 3n + 1 operations; blue transitions represent divisions by 2.
Figure 4. An inverse Collatz Petri net model reordered by transition types. Red transitions correspond to inverse 3n + 1 operations; blue transitions represent divisions by 2.
Information 16 00745 g004
Table 1. Benchmark results of the inverse Collatz construction in Python.
Table 1. Benchmark results of the inverse Collatz construction in Python.
n max PlacesTransitionsTime [s]Peak mem [KB]
100010006670.0025111.2
10 , 000 10 , 000 66670.02801446.4
100 , 000 100 , 000 66 , 667 0.297813,875.5
500 , 000 500 , 000 333 , 333 1.535765,972.4
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

Mailland, D.; Grobelna, I. A Novel Approach to the Collatz Conjecture with Petri Nets. Information 2025, 16, 745. https://doi.org/10.3390/info16090745

AMA Style

Mailland D, Grobelna I. A Novel Approach to the Collatz Conjecture with Petri Nets. Information. 2025; 16(9):745. https://doi.org/10.3390/info16090745

Chicago/Turabian Style

Mailland, David, and Iwona Grobelna. 2025. "A Novel Approach to the Collatz Conjecture with Petri Nets" Information 16, no. 9: 745. https://doi.org/10.3390/info16090745

APA Style

Mailland, D., & Grobelna, I. (2025). A Novel Approach to the Collatz Conjecture with Petri Nets. Information, 16(9), 745. https://doi.org/10.3390/info16090745

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