EditSafely

Generate P-adic Expansions

Calculate p-adic expansions. Runs entirely in your browser, so your data never leaves your device.

Output

The result appears here as you type.

Options

How to use Generate P-adic Expansions

  1. 1. Enter the fraction. Set Numerator and Denominator to define the rational number whose p-adic expansion you want, for example 1 over 3 to see how a familiar fraction looks in a p-adic base.
  2. 2. Choose the prime and term count. Set Prime p to the base for the expansion, such as 5 for the 5-adic integers, and set Terms for how many digits to compute going leftward from the point.
  3. 3. Copy the expansion. The tool computes the digits of the p-adic representation, which extends infinitely to the left rather than the right. Copy the result for your number theory notes.

When to use Generate P-adic Expansions

Generate P-adic Expansions computes the digits of a rational number in the p-adic number system for a chosen prime, a representation that extends infinitely leftward instead of rightward like ordinary decimals. Use it whenever a number theory problem needs concrete p-adic digits for a fraction.

  • Studying p-adic number theory. A student working through an introductory course on p-adic numbers wants to see how a simple fraction like 1/3 expands in the 5-adic integers to build intuition before tackling proofs.
  • Verifying Hensel's lemma examples. Someone working through examples that use Hensel's lemma to lift solutions modulo p to solutions in the p-adic integers wants verified expansions to check their intermediate steps.
  • Testing a p-adic arithmetic implementation. A developer who wrote code to compute p-adic expansions of rationals for a computational number theory project validates the output against this tool for several primes and fractions.
  • Exploring how different primes affect a number. Someone curious how the same fraction looks under different p-adic bases generates expansions for 1/3 under 2-adic, 3-adic and 5-adic systems to compare the resulting digit patterns.

Examples

1/3 in the 5-adic integers

Output

…1 3 1 3 2 (base 5)

About the Generate P-adic Expansions tool

Generate P-adic Expansions is a free online tool that works entirely inside your web browser. Calculate p-adic expansions. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.

This page is one of 234 Math utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.

You can shape the output with 4 settings, including Numerator, Denominator, Prime p and Terms, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every keystroke is handled on your own machine rather than by a remote API.

Frequently asked questions

Does Generate P-adic Expansions cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Does the generator send anything to a server?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How do I get a different result?

Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All Math Tools