Vampire Number Checker
A vampire number is a composite integer whose digits can be rearranged into two equal-length factors called fangs.
Run — free
This checker tests the complete definition instead of merely looking for a convenient factor pair. Enter a positive integer with an even number of digits, and it will report whether the number is vampiric and list every valid fang pair it finds. Inputs with an odd digit count are rejected because equal-length fangs are then impossible by definition.
What the vampire number test proves
A successful result establishes more than ordinary factorization. For an integer with 2k digits, each fang must contain exactly k digits, the two fangs must multiply to the original integer, and their combined decimal digits must match the original digits with precisely the same multiplicities. Repeated digits therefore matter: two zeros in the number require two zeros across the fangs, while a digit absent from the number cannot appear in either factor. The conventional trailing-zero restriction also applies, so a pair is rejected when both fangs end in zero. The checker evaluates all of these conditions together and returns every distinct pair in ascending order. For example, 1260 qualifies because 21 multiplied by 60 equals 1260 and the combined digits of 21 and 60 are exactly 1, 2, 6, and 0. A non-vampire result means no factor pair within the required digit length satisfies the full digit rule; it does not mean that the number is prime or has no factors.
How to enter a number and read the result
Supply n as an unsigned base-10 integer string. A string is used deliberately so the checker can preserve and count the digits exactly without scientific notation or silent numeric rounding. Do not include spaces, commas, decimal points, a plus sign, or leading zeros. The input must contain an even number of digits and may contain at most twelve digits, which keeps the exact trial search bounded for both browser and API execution. The result repeats n, reports digit_count, sets is_vampire to true or false, and provides fangs as an array of two-number pairs. An empty fangs array is a complete negative answer within the stated definition. When several valid decompositions exist, each pair is included once with its smaller fang first. If the digit count is odd, the request returns an input error rather than false: odd-length numbers fall outside the promised domain, because splitting an odd count into two equally long decimal fangs is impossible. This distinction helps automated callers separate malformed questions from valid negative results.
Why exhaustive factor checking is important
Vampire-number puzzles are easy to check incorrectly by hand. Finding factors whose digits look similar is not sufficient, and testing only one familiar pair can miss another valid decomposition. This implementation searches possible first fangs from the smallest permitted k-digit integer through the square root of n. It considers a candidate only when it divides n exactly, then verifies that the companion factor also has k digits. Finally, it compares sorted digit signatures and enforces the double-trailing-zero exclusion. Restricting the first fang to the square root avoids checking reversed duplicates without changing the result. The procedure is deterministic: identical input always produces identical pairs in the same order, and it uses no network service, random value, clock, or stored state. That makes the checker suitable for recreational number theory, classroom demonstrations, programming exercise verification, and repeatable data pipelines. Browser execution is free, while an automated API request costs $0.002. The same pure solving code supports both paths, so the interactive answer and the programmatic answer follow the same rules.
What you can do with it
Verify a number theory puzzle
Check a proposed vampire number and display the exact fang pairs that satisfy every part of the definition.
Validate generated sequences
Test candidate integers from a script and distinguish valid non-vampires from inputs outside the even-digit domain.
Teach factors and digit multisets
Demonstrate how multiplication, factor length, repeated digits, and trailing-zero rules interact in one concrete problem.
FAQ
What is a vampire number?
It is an integer with an even number of digits that factors into two equal-length fangs whose combined digits exactly reproduce the digits of the integer, with both fangs not ending in zero.
Why does an odd number of digits cause an error?
The definition requires two fangs of equal digit length. An odd number of original digits cannot be divided evenly between them, so that input is outside the checker’s domain.
Can a number have more than one fang pair?
Yes. The checker searches the full permitted factor range and returns every distinct valid pair, ordered by the smaller fang.
Are leading zeros allowed in the number or its fangs?
No. The input must use its ordinary decimal representation without leading zeros, and the numeric fang-length bounds prevent leading-zero fangs.
How much does an API check cost?
Each API request costs $0.002. You can also run the same deterministic checker free in your browser.
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/vampire-number \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":"1260"}'const res = await fetch("https://api.kit.forhosting.com/numth/vampire-number", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": "1260"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/vampire-number",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": "1260"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/vampire-number", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":"1260"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":"1260"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/vampire-number", 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": "1260"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.vampire_number",
"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 | 12 |
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. |