Computing the Landau-Ramanujan Constant

Let λ(x) denote the number of positive integers not exceeding x which can be expressed as a sum of two squares excepting 1. The function λ(x) clearly approaches infinity as x increases, but one can ask how fast it does so.  Landau and Ramanujan both independently proved that the following limit exists:

It is straightforward to estimate this limit directly using Mathematica.

\(\(ListPlot[MapIndexed[N[\@Log[#]\/#] First[#2]&, λvals[50]], 
      PlotJoined -> True]; \)\)

In 1996 Philippe Flajolet and Ilan Vardi deduced the following exact formula for the limit:

They computed 1024 digits in the decimal expansion of this limit. Using essentially the following direct Mathematica program, Victor Adamchik was then able to calculate 5100 digits.

LandauRamanujan[100]

LandauRamanujan[500]

LandauRamanujan[1000]

LandauRamanujan[5100]