The Palindrome Attempt Function can be stated very simply:
An example may make this clearer.
Let's start with 87.
That is not a palindrome, so we write down 78 and add it to 87. The result is 165, which is not a palindrome.
The next stage adds 561 to 165 and gets 726. Adding 627 to this gives 1353, which is still not palindromic.
The next stage adds 3531 to get 4884. 4884 is a palindrome, so we're done.
In summary, the PAF when applied to 87 terminates with the value 4884 after four iterations.
The PAF terminates when applied to many integers, but it is an open question whether it terminates for all integers. Indeed, there is some evidence that it does not terminate for all integers and it seems that 196 may be the smallest of these. Wade VanLandingham has called the non-terminating integers Lychrel numbers (assuming they exist!) and has created an extensive site about them at http://home.cfl.rr.com/p196/.
In the early 1980's I wrote a program in Z80 assembly language which ran the PAF on 196 for 50 thousand iterations without finding a palindrome. Wade's site gives the current situation. At mid-August 2002 the number of iterations had exceeded 41 million, still without finding a palindrome.
An open question is whether there are a finite or infinite number of solutions in integers to the equation n!+1=m2. A few small solutions are easy to find, and I won't spoil your enjoyment from finding them by giving them here. However, extensive searching by myself and others has failed to find any other solutions with n under 1 million. This project also threw up an amusing bug in the /usr/games/primes program distributed with early versions of SunOS. It may still be there in other versions of Unix for all I know.
Finger counting.
I can count from zero to a prime number on the digits of one hand, whether I do so in unary or binary. This little animation demonstrates the latter case.