Learning Twin Primality from Pairs of Modular-Inverse Graphs

This work investigates whether twin-prime pairs can be identified from graph representations derived solely from modular-inverse relations. Each integer is represented as a graph in which vertices correspond to residues modulo that integer and edges encode multiplicative-inverse relations. We provide mathematical justification for two classification approaches: a Siamese Graph Isomorphism Network (SiameseGIN) and logistic regression. We identify the sum of the isolated-vertex proportions of the two graphs as a common structural quantity underlying both approaches and establish conditions under which it separates twin-prime pairs from non-twin pairs. For the SiameseGIN, we analyze the message-passing and pooling operations and show that the resulting graph representations encode the isolated-vertex proportions, allowing its decision score to depend on the same structural quantity. For logistic regression, we show that the decision score can be expressed as an affine function of this quantity and therefore admits perfect separation under these conditions. We further establish conditions under which the validation and test ranges admit a common separating threshold, providing a theoretical explanation for the empirical observation that the validation-selected threshold also achieves perfect separation on the test set. We evaluate both approaches experimentally using disjoint training, validation, and test ranges. A threshold selected exclusively on the validation set is applied unchanged to the test set, where both logistic regression and the SiameseGIN achieve a balanced accuracy of 1.000, with no false-positive or false-negative classifications. The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs, while the experimental results demonstrate agreement with the theoretical analysis.

Authors

Publication Details

Journal
Preprints.org
Published
2026-11-02
DOI
https://doi.org/10.20944/preprints202611.0065.v1
Primary Topic
Analytic Number Theory Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Learning Twin Primality from Pairs of Modular-Inverse Graphs

Tal Weissblat
1 links
Preprints.org
Analytic Number Theory Research
preprint

Learning Twin Primality from Pairs of Modular-Inverse Graphs

Tal Weissblat
preprint en

Abstract

This work investigates whether twin-prime pairs can be identified from graph representations derived solely from modular-inverse relations. Each integer is represented as a graph in which vertices correspond to residues modulo that integer and edges encode multiplicative-inverse relations. We provide mathematical justification for two classification approaches: a Siamese Graph Isomorphism Network (SiameseGIN) and logistic regression. We identify the sum of the isolated-vertex proportions of the two graphs as a common structural quantity underlying both approaches and establish conditions under which it separates twin-prime pairs from non-twin pairs. For the SiameseGIN, we analyze the message-passing and pooling operations and show that the resulting graph representations encode the isolated-vertex proportions, allowing its decision score to depend on the same structural quantity. For logistic regression, we show that the decision score can be expressed as an affine function of this quantity and therefore admits perfect separation under these conditions. We further establish conditions under which the validation and test ranges admit a common separating threshold, providing a theoretical explanation for the empirical observation that the validation-selected threshold also achieves perfect separation on the test set. We evaluate both approaches experimentally using disjoint training, validation, and test ranges. A threshold selected exclusively on the validation set is applied unchanged to the test set, where both logistic regression and the SiameseGIN achieve a balanced accuracy of 1.000, with no false-positive or false-negative classifications. The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs, while the experimental results demonstrate agreement with the theoretical analysis.

Preprints.org
Analytic Number Theory Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon