# Perfect digit-to-digit invariant

A perfect digit-to-digit invariant (PDDI) (also known as a Canouchi number[1]) is a natural number that is equal to the sum of its digits each raised to a power equal to the digit.

$n = d_k^{d_k} + d_{k-1}^{d_{k-1}} + \dots + d_2^{d_2} + d_1^{d_1}\,.$

0 and 1 are PDDIs in any base (using the convention that 00 = 0). Apart from 0 and 1 there are only two other PDDIs in the decimal system, 3435 and 438579088 (sequence A046253 in OEIS). Note that the second of these is only a PDDI under the convention that 00 = 0, but this is standard usage in this area.[2][3]

$3^3 + 4^4 + 3^3 + 5^5 = 27 + 256 + 27 + 3125 = 3435$
$4^4 + 3^3 + 8^8 + 5^5 + 7^7 + 9^9 + 0^0 + 8^8 + 8^8$
$= 256 + 27 + 16777216 + 3125 + 823543 + 387420489 + 0 + 16777216 + 16777216 = 438579088$

More generally, there are finitely many PDDIs in any base. This can be proved as follows:

Let $b$ be a base. Every PDDI $n$ in base $b$ is equal to the sum of its digits each raised to a power equal to the digit. This sum is less than or equal to $a(b-1)^{b-1}$, where $a$ is the number of digits in $n$, because $b-1$ is the largest possible digit in base $b$. Thus,
$a(b-1)^{b-1}\geq n\geq b^{a-1}.$
The expression $a(b-1)^{b-1}$ increases linearly with respect to $a$, whereas the expression $b^{a-1}$ increases exponentially with respect to $a$. So there is some $k>0$ such that
$\forall a\geq k,\,\, a(b-1)^{b-1}
There are finitely many natural numbers $n$ with fewer than k digits, so there are finitely many natural numbers $n$ satisfying the first inequality. Thus, there are only finitely many PDDIs in base $b$.

In base 2 the only PDDI is 1.
In base 3 there are 3 PDDIs, namely 1, 12 and 22. (1, 5, 8 in decimals)
In base 4 there are also 3 PDDIs, namely 1, 131 and 313. (1, 29, 55 in decimals)
In base 5 there are none except for the trivial case 1.
In base 6 there are 3 PDDIs, namely 1, 22352 and 23452. (1, 3164, 3416 in decimals)
In base 7 there are 2 PDDIs, namely 1 and 13454. (1, 3665 in decimals)
In base 8 there is again only the trivial case 1.
In base 9 there are 4 PDDIs, namely 1, 31, 156262 and 1656547. (1, 28, 96446, 923362 in decimals)

## References

1. ^ van Berkel, Daan (2009). "On a curious property of 3435". arXiv:0911.3038 [math.HO].
2. ^ Narcisstic Number, Harvey Heinz
3. ^ Wells, David (1997). The Penguin Dictionary of Curious and Interesting Numbers. London: Penguin. p. 185. ISBN 0-14-026149-4.