1
$\begingroup$

I was just thinking, Is there some mathematical rule that is a formula for all the palindromes? And if there is a rule what is it?

$\endgroup$
1
2
$\begingroup$

The palindromes of length $1$ are $0, 1, \dots, 9$.

Let $n$ be a positive even integer; let $n = 2m$. Every palindrome of length $n$ is of the form $$\sum_{k=0}^{m-1}p_k(10^{(n-1)-k} + 10^k)$$ where $p_0, p_1, \dots, p_{m-1} \in \{0, 1, \dots, 9\}$, $p_0 \neq 0$.

Let $n$ be a positive odd integer, $n \geq 3$; let $n = 2m+1$. Every palindrome of length $n$ is of the form $$\sum_{k=0}^{m-1}p_k(10^{(n-1)-k} + 10^k) + p_m10^m$$ where $p_0, p_1, \dots, p_m \in \{0, 1, \dots, 9\}$, $p_0 \neq 0$.

$\endgroup$
2
  • $\begingroup$ Perhaps what OP wants is a formula for calculating, say, the 743rd palindrome without first finding the preceding 742. Hard to say. $\endgroup$ – Gerry Myerson Sep 23 '13 at 13:10
  • $\begingroup$ @GerryMyerson: Maybe. I think one can obtain a formula using what I've written. I'll wait to see what the OP has to say. $\endgroup$ – Michael Albanese Sep 23 '13 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.