Prime signature calculator
Shows the shape of a number's prime factorization without the primes: 360 = 2³ × 3² × 5 has signature [3, 2, 1]. Exponents are sorted from largest to smallest, so 12 and 18 both give [2, 1]. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 360
- Signature
- 3, 2, 1
A prime signature records the shape of an integer's prime factorization without retaining the prime bases themselves. Factor the number, collect the positive exponents, and sort those exponents in descending order. For example, 360 equals 2 cubed times 3 squared times 5, so its signature is [3, 2, 1].
What a prime signature represents
Every positive integer greater than one has a unique prime factorization, apart from the order in which its factors are written. If n equals p1 raised to e1, multiplied by p2 raised to e2, and so on, its prime signature is the multiset of exponents e1, e2, and so on, conventionally arranged from greatest to least. The bases disappear, leaving only the multiplicative shape.
Thus 12 equals 2 squared times 3 and 18 equals 2 times 3 squared; both have signature [2, 1], even though their prime bases are assigned differently. Meanwhile 64 has signature [6], because it is a single prime raised to the sixth power. Sorting is essential: it makes the representation canonical, so equal signatures compare as identical arrays without callers having to account for factor order.
The integer 1 has no prime factors and therefore has the empty signature [], matching the empty-factorization convention. This calculator returns that canonical array directly, making a compact invariant available without exposing or retaining the prime bases.
How to enter a number and interpret the response
Provide n as a positive decimal integer. A plain integer number is accepted when it is within JavaScript's safe integer range; a decimal string is the recommended form because it preserves every digit exactly and also supports larger values within the published 18-digit limit. A prime number returns [1], a prime power p raised to k returns [k], and a squarefree composite returns one entry equal to 1 for every distinct prime factor.
The value 1 returns an empty array. Internally, deterministic trial division extracts each exponent, and a numeric descending sort produces the final canonical multiset. No network request, random choice, or clock value can affect the result, so repeated calls are stable.
Why signatures are useful in number theory
Prime signatures group integers by factorization pattern. That viewpoint is useful when studying multiplicative functions whose values depend only on exponents, building examples for partitions, classifying perfect powers, or comparing structural properties without caring which primes occur. The divisor-count function illustrates the idea: an integer with signature [e1, e2, ...] has the product of each exponent plus one as its number of positive divisors.
A signature also reveals immediately whether a number is prime, squarefree, a prime power, a perfect square, or more generally a perfect k-th power by inspecting its entries. Teachers can use the output to separate the act of factoring from reasoning about exponent patterns, while contest programmers and data pipelines can use a compact array as a grouping key. Because the output omits prime bases by design, use a prime-factorization calculator instead when you need to reconstruct n or inspect its actual divisors.
What you can do with it
Classify factorization shapes
Group different integers that share the same exponent pattern, even when their underlying prime bases differ.
Study multiplicative functions
Use the exponent multiset as compact input for divisor counts, perfect-power checks, and related number-theory formulas.
FAQ
What is the prime signature of an integer?
It is the multiset of exponents in the integer's prime factorization, sorted in descending order and recorded without the prime bases.
What is the prime signature of 1?
It is the empty array [] because 1 has an empty prime factorization. Values below 1 are rejected.
Do two numbers with the same signature have the same factors?
Not necessarily. They have the same exponent pattern, but the exponents may belong to different prime bases.
Why are the exponents sorted?
Descending sorting creates a canonical representation, so equivalent exponent multisets always produce identical arrays.
What signature does a prime number have?
A prime always gives [1], and a prime power p raised to k gives [k], so 64 returns [6]. A product of distinct primes gives one 1 for each prime it contains.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/numth/prime-signature \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":"360"}'const res = await fetch("https://api.kit.forhosting.com/numth/prime-signature", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": "360"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/prime-signature",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": "360"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/prime-signature", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":"360"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":"360"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/prime-signature", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": "360"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.prime_signature",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_digits | 18 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This calculator performs that process deterministically for any supported positive integer, returns exact structured JSON, and treats 1 as having the empty signature. It is useful whenever factorization structure matters more than the particular primes involved.
How to enter a number and interpret the response
The aliases number and value are accepted as alternatives to n. The response contains normalized n as a decimal string and signature as an array of positive integer exponents in descending order. Zero, negative values, fractions, scientific notation, separators, missing fields, and unsupported sizes fail with invalid_input instead of producing a misleading convention.
Why signatures are useful in number theory
The browser calculator runs locally for quick exploration, and the API provides the same deterministic contract for $0.002 per successful item.
Integration use cases
Build deterministic fixtures
Generate stable canonical arrays for exercises, contest tests, notebooks, or automated validation pipelines.
Technical questions
What does the calculator cost?
The browser version runs free locally. Each successful API item costs $0.002; invalid input is rejected without a result.