[seqfan] Re: Palindome reciprocal sums

Joseph S. Myers jsm at polyomino.org.uk
Sat Jun 21 20:26:00 CEST 2014

On Sat, 21 Jun 2014, Hans Havermann wrote:

> My attempt at the sum of the reciprocals of binary palindromes yields 2.3787957...
> Is anyone else bothered by the (large) number of terms in 
> http://oeis.org/A118031 ?

Yes.  My calculation disagrees with the last five terms given there.  To 
500 digits after the decimal point, I get:


(I'm running the calculation for 1000 digits after the point now.)

I believe this can be approximated in polynomial (quartic?) time in the 
number of digits' accuracy required.  Suppose you want to compute the sum 
of the reciprocals of the d-digit palindromes (it's easy to get an upper 
bound on the sum for all those with more than a certain number of digits), 
for d > 4.  Express such a palindrome in the form A+B, where A has the 
first and last two digits of the original palindrome with all the digits 
in between replaced by 0 (and so is itself a d-digit palindrome, with 
leading digit not 0), and B has all the digits in the middle (and can be 
imagined as a d-digit palindrome with initial and final 00).  Then we want 
the sum of values 1/(A+B) for A and B numbers of that form, and 1/(A+B) = 
(1/A)(1/(1 + B/A)) = (1/A)(1 - B/A + B^2/A^2 - B^3/A^3 + ...) since B/A < 
1/10.  But rearranging, this splits into sums involving just the A, and 
sums involving just the B: (sum 1/A)(sum 1) - (sum 1/A^2)(sum B) + (sum 
1/A^3)(sum B^2).  Each sum involving just the A contains just 90 terms, 
and you can compute the sum of nth powers of k-digit palindromes (leading 
0s allowed) - the B terms - using binomial expansion and the sums for 
k-2-digit palindromes for all powers up to n.  And you can easily enough 
produce a bound on the error from truncating the series.

Doing all this with interval arithmetic produced the number given above 
(that disagrees with the last five terms of A118031).  For base 2, to 100 
digits (convergence is slower; you could trade off between the speed of 
different parts of the calculation by using more than two digits in A, but 
I haven't implemented that), I get


and again I'm running a longer computation.

Perhaps someone should confirm some of this before corrections / 
extensions / b-files are added.

Joseph S. Myers
jsm at polyomino.org.uk

More information about the SeqFan mailing list