WOLFRAM|DEMONSTRATIONS PROJECT

p-Adic Continued Fractions

​
numerator
38
denominator
40
prime
3
prime p = 3
19
20
=
-1+
1
-4/3+
1
-4/3+
1
-2/3+
1
-2/3+
1
2/3
The
p
-adic continued fraction
[
a
1
,
a
2
,…]
of a
p
-adic number is similar to the usual (simple) continued fraction in the reals with the requirement that
|
a
i
|≤p/2
. Since the rational numbers are a subset of the
p
-adics, every rational number has a unique
p
-adic continued fraction (which can be shown to be finite). This Demonstration computes the
p
-adic continued fractions for all rational numbers of the form
a/b
where
p
is less than 1000 and
a
and
b
are positive integers less than or equal to 100.