A Geometric Journey Through
Integer Factorisation
Geometric Reformulations of Fermat’s Method
and Why They Meet the Same Wall
S.A. Basson
June 2026
Abstract
This paper documents a systematic exploration of integer factorisation through
geometric arrangements of the integers. Over the course of the investigation, a series
of grid-based constructions — the extended square-row grid, the diagonal polynomial
grid, square-number ladders, the visitor parabola, GCD column scans, the
√
N
window, and the prime-free column index — were developed and each shown to
reformulate the factorisation problem geometrically. The central finding is a negative
one, established from many independent angles: every such construction is derived
from a single generating function and therefore encodes exactly the information
contained in
N
itself, reducing to Fermat’s identity
N
=
a
2
− b
2
. Consequently all
meet the same
O
(
N
1/4
) complexity wall for balanced semiprimes. We present the
constructions, the exact identities they yield, and rigorous explanations of why each
fails to break the wall. The value of the work lies in mapping, precisely and honestly,
the boundary between what geometric structure can and cannot do for factorisation.
1. Introduction and philosophy
Integer factorisation underlies modern public-key cryptography: the security of RSA rests
on the difficulty of recovering
p, q
from
N
=
pq
for large balanced semiprimes. Classical
methods — trial division, Fermat’s difference of squares, Pollard’s rho, the quadratic
sieve — are well understood, and balanced semiprimes present an
O
(
N
1/4
) barrier to all
elementary approaches.
This paper takes a deliberately geometric route. The guiding question throughout was:
can arranging the integers in a structured grid expose the factorisation of
N
as a directly
readable geometric property? The answer, arrived at repeatedly and from independent
directions, is that geometric structure faithfully encodes factorisations but does not reveal
them: every construction reduces to N = a
2
− b
2
and inherits its complexity.
We record the journey in full — including the constructions that looked promising
before their equivalence to Fermat’s method became clear — because the negative result
is itself a precise and, we believe, useful characterisation. Throughout, the operative test
for any new idea is: does it introduce information independent of the single generating
function (r − 1)
2
+ c?
2. The extended square-row grid and Fermat’s method
Definition 1 (Extended square-row grid). The extended square-row grid assigns to cell
(
r, c
),
r ∈ Z
,
c ≥
1, the value
cell
(
r, c
) = (
r −
1)
2
+
c
. Integer
N
occupies row
r
=
⌈
√
N⌉
,
1
A Geometric Journey Through Integer Factorisation S.A. Basson
column c = N − (r − 1)
2
in the standard grid.
A perfect square
a
2
appears in column
N
at row
r
∗
precisely when (
r
∗
−
1)
2
=
a
2
− N
is itself a perfect square. This is Fermat’s method in geometric dress.
Theorem 1 (Column Shift Formula). Let
N
=
pq
,
p < q
, set
hi
=
⌈
√
N⌉
and
b
=
p
hi
2
− N
. If
b ∈ Z
≥0
then
p
=
hi − b
,
q
=
hi
+
b
, and
r
∗
=
b
+ 1. The formula succeeds
in one step iff g = q − p < 2
√
p ≈ 2N
1/4
.
Proof. hi
2
− b
2
=
N
=
pq
gives
p
=
hi − b
,
q
=
hi
+
b
. The one-step condition
⌈
√
pq⌉
=
(
p
+
q
)
/
2 is equivalent to (
p
+
q
)
/
2
−
1
<
√
pq
, which expands to (
q − p
)
2
<
4(
p
+
q −
1),
i.e. g < 2
√
p asymptotically.
The wall, first sighting. Theorem 1 is exact and elegant, but the one-step success
condition
g <
2
N
1/4
fails for balanced semiprimes with even moderate gaps. Locating
b
in general requires scanning rows outward from
⌈
√
N⌉
, an
O
(
g
) search that is
O
(
N
1/4
)
in the balanced case and up to O(N) for unbalanced N.
3. The diagonal polynomial grid and GCD scans
The diagonal polynomial grid places
k
2
+
k
+
N
at row
k
, column
N
. Column
N
displays
f
N
(k) = k
2
+ k + N for k = 0, 1, 2, . . .
Lemma 1 (GCD identity).
gcd
(
f
N
(
k
)
, N
) =
gcd
(
k
(
k
+ 1)
, N
) for all
k
, since
f
N
(
k
)
≡
k(k + 1) (mod N).
Thus a factor of
N
is revealed at row
k
exactly when
p | k
or
p | k
+ 1 for some prime
p | N. The smallest such k is p − 1.
3.1 The
√
N window heuristic
At
k
=
⌊
√
N⌋
we have
k
(
k
+ 1)
≈ N
, placing
k
and
k
+ 1 in the neighbourhood of the
factors. Scanning
k
=
⌊
√
N⌋±w
yields the empirical success rates below (odd semiprimes
N < 2000):
Window ±w Checks Success rate
0 1 38.9%
1 3 63.8%
3 7 83.1%
10 21 98.5%
20 41 100%
Why the window does not scale. A factor is revealed within the window iff some
multiple of
p
(or
p −
1) lies within
w
of
⌊
√
N⌋
. For balanced semiprimes the nearest
multiple of
p
to
⌊
√
N⌋
can lie up to
p/
2
≈
√
N/
2 away, so the required window grows
as O(
√
N). High success at fixed w for small N is a size-regime artefact.
2
A Geometric Journey Through Integer Factorisation S.A. Basson
4. Square-number ladders and the visitor parabola
Two further geometric constructions were investigated in depth.
4.1 The visitor parabola
The visitor positions of
N
— the cells (
r, N −
(
r −
1)
2
) where
N
appears as a value in the
extended grid — lie exactly on the parabola
c
=
N −
(
r −
1)
2
. The squared Euclidean
distance from the grid origin (1
,
1) to the visitor at row
r
, with
u
= (
r −
1)
2
, is the exact
quadratic
D
2
(u) = u
2
− (2N − 3)u + (N − 1)
2
,
with vertex u
∗
= N −
3
2
and discriminant 5 − 4N.
Encoding
N
alone. Every coefficient of the visitor parabola and of the distance
quadratic is a function of
N
alone. The vertex merely relocates the home cell
⌈
√
N⌉
;
the discriminant 5
−
4
N
is factor-blind. No distance or projection between points on
these curves carries information about the factor gap q − p.
4.2 Square-number ladders and the semiprime squeeze
Ladder constructions contracting a 1
× N
row and testing successive divisors near
⌊
√
N⌋
produced an early heuristic (the “semiprime squeeze”) in which the first remainder
r
1
appeared close to a factor. The exact identity
r
1
=
p ·g mod s
(with
g
=
q −s
,
s
=
⌊
√
N⌋
)
was established. Large-scale testing, however, showed
r
1
uniformly distributed on (0
, s
) at
scale, refuting the heuristic as a size-regime artefact. The identity itself cannot factor
N
:
recovering p from r
1
requires g, which requires q — circular.
5. The prime-free column index
The transposed triangular grid
cell
(
n, d
) =
T
(
n
+
d−
2)+
n
has entirely prime-free columns
at
d
=
T
(
j
) + 1,
j ≥
3, with
cell
(
n, T
(
j
) + 1) = (
n
+
T
(
j −
1))(
n
+
T
(
j
+ 1))
/
2; this family
and its perfect-square discriminant characterisation are established in [
1
]. Every composite
number lies in at least one such column, prompting the question: can the column index of
a semiprime be computed from N alone?
Proposition 1 (Column membership).
N
lies in prime-free column
d
=
T
(
j
) + 1 iff
2N = A · B with B − A = 2j + 1 and A ≥ T (j − 1) + 1; the row is n = A − T (j − 1).
Equivalence to factoring. By Proposition 1, naming a prime-free column of
N
requires a factor pair of 2
N
with prescribed odd difference — which immediately
yields a factor pair of
N
. Locating the column is factoring, in geometric coordinates.
Corollary 1 (Balance and column index). For
N
=
pq
with
p < q
, the most balanced
factorisation gives the smallest odd difference and hence the lowest prime-free column
index. Balanced semiprimes — the cryptographically hard case — occupy the lowest-index
columns near the top of the grid. The column index is a direct geometric readout of the
factor gap q − p.
3
A Geometric Journey Through Integer Factorisation S.A. Basson
6. Synthesis: one wall, many faces
Unifying principle. The extended square-row grid, the diagonal polynomial grid, the
square-number ladders, the visitor parabola, the GCD column scan, the
√
N
window,
and the prime-free column index are all derived from a single generating function
— (
r −
1)
2
+
c
or its triangular analogue. Any quantity built from that function by
substitution, differencing, Euclidean distance, or re-coordinatisation is a function of
N
alone. Each construction therefore reduces to Fermat’s identity
N
=
a
2
− b
2
and
inherits its O(N
1/4
) complexity for balanced semiprimes.
The geometric approach does not defeat the factorisation wall; it illuminates it. Each
construction offers a different visual account of why balanced semiprimes are hard — the
factors sit symmetrically about
√
N
, the factor gap is invisible to any single-parameter
readout, and the answer, though guaranteed to lie on a known curve, cannot be reached
without a scan whose length is governed by the very gap one seeks.
Remark 1 (On the value of a mapped boundary). Establishing precisely where geometric
structure stops being useful is a genuine contribution. The constructions here are exact
and, in several cases, practically useful for unbalanced semiprimes, where a factor sits close
to
⌊
√
N⌋
or to a low-index column. For the balanced case that matters cryptographically,
the wall stands — and now stands explained from a family of independent geometric
viewpoints.
7. Open questions
1.
Is there any grid construction introducing a second equation genuinely independent of
N
=
a
2
− b
2
? Every construction studied here reduces to it; whether the reduction is
unavoidable for all polynomial grids is open.
2.
Does the distribution of
⌊
√
pq⌋ mod p
over prime pairs admit a closed form? This
governs the
√
N window success rate.
3.
Can the prime-free column index of Proposition 1 be approximated (not computed
exactly) from
N
in a way that narrows the search, without already determining the
factorisation?
References
[1]
S. A. Basson, Integer Grids, Fermat’s Method and Prime-Free Sequences: New Results
from Geometric Arrangements of the Integers, Zenodo preprint, 2026.
https://doi.
org/10.5281/zenodo.20428137
4