ForHosting KIT · Math

Super-prime checker

11 is the fifth prime and 5 is prime, so 11 is a super-prime; 7 is the fourth prime, and 4 is not. Enter a number to see its place among the primes and whether that place is prime too. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
11
You get
Index
5

A super-prime, also called a superprime or a prime-indexed prime, is a prime number whose position in the sequence of all primes is itself a prime. The ordered primes begin two, three, five, seven, eleven, thirteen, seventeen; their one-based indices are one through seven. Indices two, three, five, and seven are prime, so three, five, eleven, and seventeen are super-primes, while two (index one) and seven (index four) are ordinary primes only. This checker takes a single integer n. The algorithm is a deterministic sieve with no network, randomness, or clock.

What a super-prime is and how the verdict is shaped

A super-prime is defined from two nested primality conditions. First, n itself must be prime: it has no positive divisor other than one and itself. Second, if n is the k-th prime in the usual increasing sequence p one equals two, p two equals three, p three equals five, p four equals seven, p five equals eleven, and so on, then k must also be prime.

The index k is exactly the prime-counting value π(n) whenever n is prime, because π(n) counts how many primes are less than or equal to n, and n occupies that last slot. The sequence of super-primes therefore begins three, five, eleven, seventeen, thirty-one, forty-one, fifty-nine, sixty-seven, eighty-three, one hundred nine — those are the primes at prime indices two, three, five, seven, eleven, thirteen, seventeen, nineteen, twenty-three, and twenty-nine.

Notice that two equals p one is excluded because one is not a prime index, and seven equals p four is excluded because four is composite.

Input contract, limits, and how the index is computed

After the integer is accepted the engine first tests whether n is prime by trial division on a six-step wheel. If n is prime the engine runs a Sieve of Eratosthenes on the interval from zero through n, counts how many unmarked integers sit at or below n, and treats that count as the one-based index k. A second trial test then decides whether k is prime.

Prefer a dedicated is-prime checker when you only need a yes-or-no on n, and prefer an nth-prime calculator when you already know the index and want the prime itself. This page answers the combined question: given a prime, is its index also prime?

Where a super-prime checker earns its keep

Classrooms and contest coaches use a super-prime checker so learners can classify prime-indexed primes without building a sieve by hand or trusting an opaque online list. Exam generators need a deterministic oracle that marks composites as invalid input instead of silently returning false, because a buggy grader might treat a false flag as a successful classification of a non-prime. Notebooks that filter a column of candidate primes down to super-primes can call the contract once per cell and keep the returned index for an audit column.

Pair this tool with a prime checker when you want composites classified instead of rejected, and with an nth-prime calculator when you want to walk the sequence by index rather than test a candidate already in hand.

Classroom classification of prime-indexed primes

Let students submit a prime n and see both the index k and whether k is prime, so the super-prime verdict is explained rather than announced.

Filter a prime list down to super-primes

Walk a column of candidate primes, keep those whose index is prime, and store the returned index beside each kept value for an audit trail.

What is a super-prime?

A super-prime (also called a prime-indexed prime) is a prime n that sits at a prime position in the sequence of primes. If n is the k-th prime, n is a super-prime exactly when k is prime.

Is 2 a super-prime?

No. Two is the first prime, so its index is one, and one is not prime. Three is the smallest super-prime.

How is the index computed?

When n is prime the index is π(n), the number of primes less than or equal to n. The engine counts them with a Sieve of Eratosthenes on 0…n, then tests whether that count is prime.

Is 7 a super-prime?

No. 7 is a prime, but it is the fourth one in the list 2, 3, 5, 7, and 4 is not a prime, so 7 is an ordinary prime and not a super-prime.

Why is 11 a super-prime?

Counting the primes 2, 3, 5, 7 and 11, the number 11 sits in fifth place. Since 5 is also a prime, both conditions hold and 11 is a super-prime.

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.

POSThttps://api.kit.forhosting.com/numth/super-prime

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.

curl -X POST https://api.kit.forhosting.com/numth/super-prime \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":11}'
{
  "n": 11
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "numth.super_prime",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_n1000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

When n is not prime the task fails with invalid_input, because the property is defined only for primes. When n is prime the response returns the index of n and whether that index is prime.

What a super-prime is and how the verdict is shaped

This checker encodes that definition strictly: a composite n is rejected with invalid_input rather than answered as not a super-prime, so a caller cannot confuse four is not prime with seven is prime but not super-prime. The success payload always names n, the boolean super_prime, the integer index, and the boolean index_prime. When the call succeeds, super_prime and index_prime hold the same value; both are kept so a teaching page can print the index test next to the verdict without recomputing π(n) on its own.

Input contract, limits, and how the index is computed

POST a JSON body with the required integer field n, or use the aliases number, value, or p. The value may arrive as a JSON number, a decimal digit string, or a bigint; fractions, booleans, empty strings, scientific notation, and values outside two through one million fail with invalid_input naming the field. The published ceiling keeps the sieve inside a small typed array so the free browser path stays instant and the Worker isolate never walks an unbounded range. If that test fails the request is rejected with a message that n is not prime — those failures are not billed.

Where a super-prime checker earns its keep

Keep n an integer of at least two and at most the published million ceiling, treat invalid_input as a client fix rather than a retry, and store both the index and the super_prime flag if you need to explain why a prime was accepted or rejected.

Deterministic contest and OEIS fixtures

Pin known super-primes such as eleven and seventeen, and known non-examples such as seven, in unit tests without embedding a static sequence dump.

Why does a composite n fail instead of returning false?

Super-primes are defined only for primes. A composite such as nine is not a candidate, so the task fails with invalid_input rather than a success payload with super_prime false. That keeps “not prime” distinct from “prime but not super-prime.”

What does the super-prime checker cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →