Appeared in the journal Mathematical Spectrum 40(1) 2007/2008.


The Picture-Perfect Numbers


Joseph L. Pe

iDEN System Engineering Tools and Statistics


                                                1421 W. Shure Drive

                                                Room S151

                                                Arlington Heights, IL 60004





1.      Introduction


Picture-perfect numbers (ppn’s), a species of the generalized perfect numbers introduced in [P], are defined as the numbers n such that the reverse of n equals the sum of the reverses of the proper divisors of n. This article tells the story of a concerted search for ppn’s, leading to the discovery of a structure theorem for these numbers. The theorem, called Andersen’s theorem after its discoverer, states that the number p = 140{0}z10{9}n89 is prime if and only if the product 57 p is picture-perfect, where {0}z, {9}n are finite sequences of z > 0 zeros and n > 0 nines, respectively. This article also considers some extensions and open problems, such as Ganson’s conjecture that every ppn is divisible by 3.


In this discussion, number refers to natural number. Functions are called arithmetical if their domains are sets of integers. For simplicity, an arithmetical function in this article will also be integer-valued and have the set of natural numbers as its domain. Unless otherwise noted, sequence numbers (which begin A…) refer to those used in [S].


2.      Perfect Number Recreations


The paper [P] introduced generalized perfect numbers. If f is an arithmetical function, then the set of f-perfect numbers is the collection of numbers n such that f(n) equals the sum of  f(d), where d ranges over all proper divisors of n; symbolically,




While this generalization adds a new perspective to the question of the existence of odd perfect numbers (odd numbers appear late in perfect number sequences such as A066229, where f(n) = n + 1), it can also provide amusing and curious relations for f that transforms its argument’s digits in some way.


As a quick example, let f(n) = n<>n, the concatenation of n with itself (e.g., f(123) = 123123). Then 6 is an f-perfect number (indeed, it is the only such number less than 106), and also 6 is the first perfect number. This observation yields the pretty pair of equations


     6   = 1   + 2   + 3

     66 = 11 + 22 + 33.


Let R(n) denote the reverse of n, with leading zeros ignored (e.g., R(123) = 321 and R(120) = 21).  In the next section, the f-perfect numbers resulting from f(n) = R(n), will be examined.



3. The Elusive Picture-Perfect Numbers


There is something very special about the number 10311.


Recall that a number is perfect if it equals the sum of its proper divisors. 10311 is not perfect: its proper divisors are 1, 3, 7, 21, 491, 1473, 3437, which sum to 5433. (Since 5433 < 10311, 10311 is said to be "deficient".) Hence, the equation


     10311 = 1 + 3 + 7 + 21 + 491 + 1473 + 3437


is not valid. However, reading this invalid equation backwards gives


     7343 + 3741 + 194 + 12 + 7 + 3 + 1 = 11301


which, amazingly, is valid!


A number n is called picture-perfect or mirror-perfect if the reverse of n equals the sum of the reverses of the proper divisors of n. (Ignore leading 0s.) In short, n is an f-perfect number, where f(n) = R(n). If n is placed on one side of an equality sign and the (unevaluated) sum of the proper divisors of n are placed on the other side, then the resulting equation read backwards is valid. This explains the use of the term “picture-perfect”, since a picture of an object is a mirror image (i.e., an orientation reversal) of that object.


The first picture-perfect number (ppn, for short) is 6, the first perfect number; but since 6 and its proper divisors are single digit, it is trivially picture-perfect. The first non-trivial ppn is 10311.


If P is a ppn, then call the expression P =b D, where D is the (unevaluated) sum of the proper divisors of P, the mirror equation of P. The symbol =b indicates that the mirror equation should be read backwards to be valid. For example, the mirror equation of 10311 is


     10311 =b 1 + 3 + 7 + 21 + 491 + 1473 + 3437.


Here is Mathematica code to generate picture-perfect numbers not exceeding 1010:


            f[n_] := FromDigits[Reverse[IntegerDigits[n]]];

            n = 2; (*Initial value of n*)

            While[n<10^10, If[f[n]==Apply[Plus,Map[f, Drop[Divisors[n], -1]]], Print[n]]; n++]


When my computer search had turned up no new ppn’s less than 107, I was about to conjecture that 10311 was the only non-trivial such number. However, after several hours of Mathematica running on my machine, I was rewarded with the third ppn: 21661371, which has mirror equation


     21661371 =b 1 + 3 + 9 + 27 + 443 + 1329 + 1811 + 3987 + 5433 + 11961 +    

                                     16299 + 48897 + 802273 + 2406819 + 7220457.


The discovery of this large ppn raised hopes that a fourth number would be found before long. Two problem enthusiasts, Daniel Dockery and Mark Ganson, soon joined me in the search. Our group has a discussion forum [Su] which we use to share ideas and results, as well as software customized for ppn search. For example, Ganson provides a Windows search utility he has written. The results and conjectures mentioned in this article first appeared in [Su].


We focused our efforts on the interval from 109 to 1010. Three weeks later, Dockery found the fourth ppn. It is the ten-digit 1460501511, with mirror equation


                1460501511 =b 1 + 3 + 7 + 21 + 101 + 303 + 707 + 2121 + 688591 +

                     2065773 + 4820137 + 14460411 + 69547691 + 208643073 + 486833837.


After this find, our progress was slow, even though Ganson’s C++ search program ran at least twice as fast as Mathematica. Then Jens Kruse Andersen joined the team by announcing his discovery of a new ppn: 7980062073 with mirror equation


     7980062073 =b 1 + 3 + 19 + 57 + 140001089 + 420003267 + 2660020691.


Devising an efficient algorithm that caches divisor information, Andersen quickly tested all numbers up to 1010, and concluded that there are no more ppn’s in this range other than the five already mentioned above. Within a month, our team exhaustively searched the interval from 1010 to 1012 using Andersen’s program.


The sequence of ppn’s


            6, 10311, 21661371, 1460501511, 7980062073, 79862699373, 798006269373, …


is sequence A069942 of [S], and also appears in its short index. “Small” ppn’s are rare pearls in the infinite ocean of numbers—there are only five ppn’s below 1010. The seven ppn’s listed above are all the ppn’s less than 1012. At the time of writing, the value of the eighth ppn is unknown. Unexpectedly, this sparseness is somewhat relieved in the realm of large numbers, as the next section will show.


4. Andersen’s Theorem


The even perfect numbers can be generated by Euclid’s expression 2n-1 (2n-1),

where n is a prime such that (2n-1) is also prime. Is there an expression yielding (not necessarily all) picture-perfect numbers?


Andersen discovered the remarkable result that if the decimal number p = 140z10n89 is prime, then the product 57 p is picture-perfect, and conversely, where z is any number (possibly none) of 0s and n is any number (possibly none) of 9s. In particular, if n has no 9s, then 57 p has the form 798z62073; if n has at least one 9, then 57 p has the form 798z626m373 where m has one 9 less than n. The proof of Andersen’s beautiful theorem appears towards the end of this section. (In this article, a product such as 57 p is often written with a space between the multiplicands to distinguish it from concatenations of digits such as 140z10n89.)


Call a prime p of the form 140z10n89 an Andersen prime, and its corresponding picture-perfect number 57 p an Andersen number. Examples of Andersen prime/ number pairs are:


            Andersen Prime                                 Corresponding Andersen Number


            140001089                                          7980062073

            1401099989                                        79862699373

            14000109989                                      798006269373

            140000109999989                              7980006269999373


The finite sequences z, n, and m (as defined above) appear in boldface.


Soon after Andersen’s announcement of his result, Ganson used Andersen’s theorem to identify 204 (mostly huge) Andersen numbers, the largest with 177 digits. This is the gargantuan 798z626m373 where z has 77 zeros and m has 91 nines. Eventually, Ganson and Andersen discovered thousands of Andersen primes. At the time of writing, the largest Andersen prime known is the 2461-digit 140 x 102458 + 1089, verified as prime by Andersen using the program Primo by Marcel Martin. Its corresponding Andersen number is the 2462-digit 798 x 102459 + 62073. Andersen and Ganson have also found probable Andersen primes with more than 104 digits, but there currently seems to be no way to prove primality for numbers of this size.


The sequence of picture-perfect numbers is an example of a sequence that appears at first to be extremely sparse—even finite—but yields many terms in the scale of the very large. Indeed, the sequence of ppn’s has been compared to what first appears to be a faint star in the universe of numbers, but is then revealed to be an abundant galaxy by the computer-telescope. An open problem is whether picture-perfect numbers such as 10311 can generate other picture-perfect numbers in the same way as Andersen’s 7980062073 does.


The proof of Andersen’s theorem now follows. The proof is due to Andersen, except for the proof of Andersen’s lemma, which I have provided.


Andersen’s Lemma If p (not necessarily prime) is of the abovementioned form 140z10n89, then R(57 p) = 170 + R(p) + R(3 p) + R(19 p).


Assuming for the meantime the validity of the lemma, suppose that p is prime. Then the proper divisors of 57 p = 3 x 19 x p are


            1, 3, 19, 57, p, 3 p, 19 p.                                 (D)


Adding the reverses of these proper divisors,

R(1) + R(3) + R(19) + R(57) + R(p) + R(3 p) + R(19 p)

= 170 + R(p) + R(3 p) + R(19 p)

= R(57 p), by the lemma.


            Hence, 57 p is picture-perfect.


Conversely, if p is not prime, then 57 p will have more divisors than (D) above, and the sum of the reversed divisors becomes larger than 170 + R(p) + R(3 p) + R(19 p) = R(57 p). Hence, 57 p is not picture-perfect. This completes the proof of Andersen’s theorem.


To establish Andersen’s lemma, consider two cases.


Case (1) n has at least one 9, that is, p = 140z10n89. In what follows, the finite sequences z, n, and m (as defined above) appear in boldface. To simplify notation (which can easily get cluttered with subscripts), z, n, m appear as 00, 999, and 99, respectively. There is no loss of generality here: the boldfaced finite sequences can be replaced by arbitrary sequences in the appropriate manner without affecting the correctness of the proof. For example, everywhere in the proof, 00 (i.e., z) and 999 (i.e., n) can be replaced by, say, 0000 and 9999, respectively, in which case, 99 (i.e., m) must then be replaced by 999.


One should convince oneself of the generality of the argument by performing the arithmetical operations below by hand. In doing so, one gains a better understanding of the numerical patterns at work here.


            Thus, with p = 140001099989, simple multiplication shows that


                 57 p = 7980062699373      R(57 p) = 3739962600897

                 19 p = 2660020899791      R(19 p) = 1979980200662

                 3 p = 420003299967          R(3 p) = 769992300024

                 p = 140001099989             R(p) = 989990100041


Adding R(19 p), R(3 p), R(p), and 170 gives R(57 p), as




                        +            769992300024





            Case (2) n has no 9s, that is, p = 140z1089. The proof here is handled similarly as in case (1). I only mention the final summation of R(19 p), R(3 p), R(p), and 170 to R(57 p), using the same notation as case (1):



                        +            762300024





5.      Conjectures and Extensions


Recently, Andersen discovered an extension of his theorem: p = 140{{0}z(k)10{9}n(k)89}k is prime if and only if 57 p is picture-perfect, where {0}z(k), {9}n(k) are finite sequences of z(k) > 0  zeros and n(k) > 0 nines, and {{0}z(k)10{9}n(k)89}k is a finite sequence of k > 0 finite sequences of the form {0}z(k)10{9}n(k)89. This extension is proved similarly as the original theorem.


            Andersen conjectures that there are infinitely many Andersen primes (for both his

            theorem and its extension), hence infinitely many corresponding Andersen



Even before the third number 21661371 had been found, Ganson had conjectured that all picture-perfect numbers are divisible by 3. Of course, the discoveries of 21661371, 1460501511, and the many Andersen numbers, all multiples of 3, have further strengthened Ganson’s conjecture.


Since the ancient Greeks first posed it, the conjecture that every perfect number is even has remained unanswered. Of course, in the “mirror”, things appear reversed. Ganson and I conjecture that every non-trivial picture-perfect number is odd. (6, the only trivial picture-perfect number, is even.) We also believe that 6 is the only number that is both perfect and picture-perfect.


Ganson investigated picture-perfect numbers in bases other than 10. In base 6, he found only four such numbers not exceeding 106: 28 = 446, 145 = 4016, 901 = 41016, and 1081 = 50016. For example, 145 = 4016 has mirror equation


     4016 =b 456 + 56 + 16,


where the sum on the right-hand side of the equation is a base-6 sum.


More intriguingly, Ganson found 41 base-5 picture-perfect numbers less than 106.

Continuing the computation, Dockery found 38 more such numbers less than

2.1 x 107. All but one of these 79 base-5 numbers are divisible by 3. The single exception is 5. However, Ganson notes that for any prime p, p has only one proper divisor (i.e., 1) and has a base-p representation as 10; therefore p is trivially base-p picture-perfect. 5 is trivially base-5 picture-perfect. Thus, Ganson conjectures that every non-trivial base-5 picture-perfect number is divisible by 3.


Observe that a perfect number n is (trivially) picture-perfect in any base b larger than n. This is because n and its proper divisors have one-digit base-b representations. For example, 6 and 28 are picture-perfect in base 29. A perfect number n is also picture-perfect in base n-1, where n is represented as the palindronomic 11 and all proper divisors of n are single-digit, so reversing changes nothing.


Here is the Mathematica code Ganson used to investigate the situation for other bases:


     f[n_] := FromDigits[Reverse[IntegerDigits[n, base]], base];
     baseDivisors[n_, base_] := IntegerDigits[Drop[Divisors[n], -1], base];
     Do[startFrom = 2;Do[If[f[n] == Apply[Plus, Map[f, Drop[Divisors[n], -1]]],
     Print["base = ", base, ", n = ", n, ") ", IntegerDigits[n, base],
     " divisors: ", Drop[Divisors[n], -1], " base divisors: ",
      baseDivisors[n, base]]], {n, startFrom, 10000}], {base, 2, 10}]


To conclude this section, I mention two variations of the ppn sequence. A number n is called tcefrep (“perfect” spelled backwards) if R(n) = the sum of the proper divisors of n. n is called anti-perfect if n = the sum of the reverses of the proper divisors of n.


The first five tcefrep numbers are


6, 498906, 20671542, 41673714, 73687923


            (Sequence A072234.) Andersen discovered that 4158499614 is tcefrep,

            although  it might not be the sixth term. Ganson conjectured that all tcefrep

            numbers are divisible by 3 (“Nosnag’s” conjecture).      


            On the other hand, no obvious pattern applies to the first five anti-perfect numbers


                        6, 244, 285, 133857, 141635817


            (Sequence A072228.) Andersen, who found the fifth term, checked that

            these are all the terms less than 1010.


6. Picture-Perfect Semi-Primes


Little is known about the ppn’s in general, especially those not generated by Andersen’s theorem. In investigating ppn’s, it is natural to start with numbers having few prime factors. Obviously, no prime can be a ppn. Hence, the simplest possible ppn’s are the semi-prime ppn’s, that is, ppn’s with exactly two prime factors. 6 = 2 x 3 is the smallest semi-prime ppn and the only one currently known.


Ganson asked if a number of the form 3 p, with p > 3 prime, can be a ppn. I answered this question in the negative; the proof now follows.


If such a prime p did exist, then the proper divisors of n = 3 p are: 1, 3, p. By definition,

R(3 p) = R(1) + R(3) + R(p),

that is,

R(3 p) - R(p) = 4.    (*)

By simple exhaustive computation, any such p > 2 must have at least three digits. Only two cases are possible:

Case 1. R(p) and R(3 p) have the same number of digits. By (*), the first digits (starting from the left) of R(p) and R(3 p) must differ by at most 1. Reversing, we see that the last digits of p and 3 p must differ by at most 1. The only way this can be satisfied is for the last digit of p to be 0 or 5. Obviously, this is a contradiction, since a prime cannot end in 0 or 5.

Case 2. R(3 p) has one more digit than R(p). Then by (*), the first digit of R(3 p) is 1 and the first digit of R(p) is 9. Reversing, the last digit of 3 p is 1 and the last digit of p is 9. This is a contradiction since the last digit of 3 p would have to be 7 if the last digit of p was 9.

In any case, a contradiction is reached.


I also discovered the following result on semi-prime ppn’s: There is no ppn

semi-prime with each of its prime factors having at least four digits. That is to say, any ppn semi-prime has a prime factor less than 1000.

For the proof, assume for a contradiction that N = p q is a semi-prime such that p, q are distinct primes that have at least four digits. Then the condition that N is a ppn is equivalent to

R(p q) = R(1) + R(p) + R(q),

since the proper divisors of N are 1, p, q. That is to say,

R(p q) = 1 + R(p) + R(q)      (**).

Because the prime factors of N have at least four digits, none of them can be = 2 or 5, so that N cannot be divisible by 10, hence cannot end in the digit 0. Therefore, the number of digits of N is unchanged by reversing N. Let d(n) denote the number of digits of n. Recall that d(n) = , where  denotes the greatest integer < x. Then

d(R(p q)])

= d(p q)




> d(p) + d(q) - 2
> max{d(p),d(q)} + 1               (since p and q each have at least four digits)
> d(1 + R(p) + R(q)).

Therefore, the left-hand side of (**) has more digits than the right-hand side of (**), so that (**) cannot be satisfied. Hence, N cannot exist.



7. Picture-Amicable Pairs


Let D(n) denote the sum of f(d), where d ranges over all proper divisors of n. For an arithmetical function f, a pair of numbers a, b is called f-amicable if f(b) = D(a) and f(a) = D(b) (cf. [P]). A pair a, b is called picture-amicable (or mirror-amicable) if a, b is an f-amicable pair for f(n) = R(n).


I had the pleasure of discovering the picture-amicable pair 2320000, 34049. The mirror equations of a picture-amicable pair can be defined similarly as for picture-perfect numbers. This pair has mirror equations


     2320000 =b 1 + 79 + 431


     34049 =b 1 + 2 + 4 + 5 + 8 + 10 + 16 + 20 + 25 + 29 + 32 + 40 + 50 + 58 + 64 + 80 + 100 + 116 + 125 + 128 + 145 + 160 + 200 + 232 + 250 + 290 + 320 + 40 + 464 + 500 + 580 + 625 + 640 + 725 + 800 + 928 + 1000 + 1160 + 1250 + 1450 + 1600 + 1856 + 2000 + 2320 + 2500 + 2900 + 3200 + 3625 + 3712 + 4000 + 4640 + 5000 + 5800 + 7250 + 8000 + 9280 + 10000 + 11600 + 14500 + 16000 + 18125 + 18560 + 20000 + 23200 + 29000 + 36250 + 40000 + 46400 + 58000 + 72500 + 80000 + 92800 + 116000 + 145000 + 232000 + 290000 + 464000 + 580000 + 1160000.


The sum of the proper divisors of 34049 appear on the right side of the first equation, and the sum of the proper divisors of 2320000 appear on the right side of the second equation.


I used the following Mathematica code to generate picture-amicable pairs {n, b}:


f[x_] := FromDigits[Reverse[IntegerDigits[x]]];
d[x_] := Apply[ Plus, Map[ f, Drop[Divisors[ x], -1] ] ];
Do[a = d[n]; b = f[a]; c = d[b]; u = Last[IntegerDigits[a]];
If[u != 0 && n != b && c == f[n], Print[{n, b}]], {n, 2, 10^8}]


For each n in the test range, the program computes D(n). It must then find b such that R(b) = D(n). The problem now is that there are infinitely many b which when reversed equal D(n). For example, 321 = R(123) = R(1230) = R(12300), etc. The program makes the simplest choice of b, that is, b = R(D(n)). However, to ensure that R(b) = D(n), the last digit of D(n) must not be 0 (which would be lost upon reversal); hence, the condition “u!=0” is necessary. Finally, the program checks that R(n) = D(b) and that   n != b, since n = b yields at most a picture-perfect number.


My computer search has reached as far as n = 2 x 107. Using this code, I found another picture-amicable pair: 10223000, 1790947. Exercise: find the mirror equations of this pair.


Readers may enjoy finding other picture-amicable pairs or even picture-sociable chains. Since the reverse function is not injective, my program does not perform an exhaustive search (not all possible values of b are tested). Perhaps a resourceful reader will write an exhaustive search program. This might appear to be an impossible task since infinitely many b have to be inspected for a particular n. However, some variation of Cantor’s “zigzag argument” for the countability of the rational numbers can probably be used to circumvent this difficulty.

Acknowledgments. I would like to thank Jens Kruse Andersen, Daniel Dockery, and Mark Ganson for their valuable contributions to and interest in picture-perfect numbers; and Mohammad Khadivi for his suggestions to improve this article.


























      [B] Beiler, A. “Recreations in the Theory of Numbers”, Dover Publications,

            NY 1964.

      [HW] Hardy, G. H. and Wright, E. M. “Introduction to the Theory of Numbers”  

           (Fifth Edition), Oxford University Press, 1983.

      [P] Pe, J. “On a Generalization of Perfect Numbers” in The Journal of

           Recreational Mathematics 31(3).

            [S] Sloane, N. “The Online Encyclopedia of Integer Sequences” at the following



[Su] Andersen, J., Dockery, D., Ganson, M., Pe, J. Systematic Undertaking to

       Find Picture-Perfect Numbers (Super) Message Board at the following URL:


[W] Wells, D. “The Penguin Dictionary of Curious and Interesting Numbers”,      

      Penguin Books, 1998.