I know it can be done really easily with an algorithm, but is there any way to mathematically test a number (of indeterminate size) to see if it is palindromic?
Seems to me that to do it for any size number, you’d need to take the log (base 10) to get number of digits, and then use a summation, at least. So even “mathematically,” it seems like you’ll be iterating. If you know the number of digits beforehand, writing an equation isn’t tough, though.
If (a div b) gives the integer result of a/b, and (a mod b) gives the integer remainder of a/b, then for any seven-digit number x, |(x div 1000000) - (x mod 10)| + |((x div 100000) mod 10) - ((x div 10) mod 10)| + |((x div 10000) mod 10) - ((x div 100) mod 10)| = 0 if the number is palindromic, and non-zero otherwise. Expanding this to the general case just means iterating through the various powers of ten (to half the digits), and the sum should be 0.
As I said at first, this can be expressed on paper with just a formula (somebody who knows the symbol sets here on the SDMB will be along shortly, I’m sure), but implementing the formula will require a loop. Even the examples I found on the Web of code for reversing an integer (which, subtracted from the original would yeild 0 for a palindrome) all use loops, so I suspect there’s no set of simple, non-iterative operations which will do the job.
But, IANAMathematician.