← All problemsSign in

A Priming Pan

An $n$-digit number is said to be pandigital if it uses all the digits from $1$ to $n$, both inclusive, exactly once. For example, a $4$-digit pandigital number is $2134$ since it uses all the digits from $1$ to $4$ exactly once. Your task is to find the largest pandigital number below a million which is also prime. If no such number exists, output a $1$. Since the result can be large, output you

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start