THE INVERSE OF THE LOGARITHMIC INTEGRAL

120 downloads 0 Views 358KB Size Report
(FROM WIKIPEDIA - The Free. Encyclopedia). Mathematica evaluates .... the quantity of prime numbers less than or equal x = 997 is. In[184]:= PrimePi 107.
THE INVERSE OF THE LOGARITHMIC INTEGRAL. By : Alvaro H. Salas - Universidad Nacional de Colombia In this short note I show the way we may find the inverse of the logarithmic integral function by using a numerical procedure based on the Mathematica command ' FindRoot '.

THEORETICAL BACKGROUND (FROM WIKIPEDIA - The Free Encyclopedia)

Mathematica evaluates this function with arbitrary precision.

2

InverseLogIntegral_RG.nb

In[137]:=

Plot[LogIntegral[x], {x, 0, 6}] 4

2

1

Out[137]=

-2

-4

-6

2

3

4

5

6

InverseLogIntegral_RG.nb

3

4

InverseLogIntegral_RG.nb

The Inverse of the LogIntegral Function. I will describe the method by using a numerical procedure. Let y = Li (x), x > 1. For a given real number y, we need to solve the equation li (x) = y with respect to x. The only solution to this equation on the interval 1, + ∞ is denorted by Li -1 (y). Thus, Li (x) = y means that x = Li-1 (y). The function Li-1 is named the inverse log integral function. ALGORITHM TO FIND THE INVERSE OF THE LOGARITHMIC INTEGRAL FUNCTION. In[217]:=

(*THIS SIMPLE PROGRAM IMPLEMENTS THE INVERSE OF THE LOGARITHMIC INTEGRAL : Li:1,∞→ (-∞,+∞); Li-1 :(-∞,∞)→1,∞*) Clear[x, y]; invLi[y_] := IfAbs[y] < 10-17 , 0, Rex /. FindRooty ⩵ LogIntegral[x], 1 , WorkingPrecision → 20, PrecisionGoal → 15 x, - y ProductLogy + 10-5 I VARIANTS

FIRST VARIANT f[x_ ? NumberQ] := y /. FindRoot[LogIntegral[y] ⩵ x, {y, x * Log[x]}, WorkingPrecision → 20, PrecisionGoal → 12] (*https://mathematica.stackexchange.comquestions67319inverse-of-logintegral*) Example : f[10 ^ 200] (*Out[55]=4.6565831394119416907*10^202*)

SECOND VARIANT f[x_ ? NumberQ] := y /. FindRoot[LogIntegral[y] ⩵ x, {y, x * Log[x]}, WorkingPrecision → 20, PrecisionGoal → 12] Log[10] NIntegrate10 ^ n  f[10 ^ n] ^ 2, {n, 7, 200}, MinRecursion → 5, MaxRecursion → 20 (*https://mathematica.stackexchange.comquestions67319inverse-of-logintegral*) EXAMPLES.

InverseLogIntegral_RG.nb

L = Table[{y, invLi[y]}, {y, - 5, 100, 5}] (*FIRST EXAMPLE*) Out[172]=

{{- 5, 1.0037759508507739765}, {0, 0}, {5, 7.4808702615776414316}, {10, 20.284365456596612497}, {15, 36.936150960780908988}, {20, 56.079609874145661968}, {25, 77.039277332985500514}, {30, 99.419463474801318372}, {35, 122.96234319312622687}, {40, 147.48736152141479213}, {45, 172.86137102588512201}, {50, 198.98230601273904272}, {55, 225.76953729484800543}, {60, 253.15782131414857540}, {65, 281.09331841067436707}, {70, 309.53086870441122990}, {75, 338.43206718432439117}, {80, 367.76386595866032941}, {85, 397.49753537884866758}, {90, 427.60787618850989471}, {95, 458.07261144273060196}, {100, 488.87190985280753191}} ListPlot[L, Joined → True, AspectRatio → 1](*SECOND EXAMPLE*)

400

300

Out[162]=

200

100

20

40

60

80

SetPrecision[LogIntegral[invLi[12.123456789]], 12](*THIRD EXAMPLE*) Out[164]=

12.1234567890 SetPrecision[invLi[LogIntegral[100.12377553322]], 12](*FOURTH EXAMPLE*)

Out[165]=

100.123775533

5

6

InverseLogIntegral_RG.nb

ParametricPlot[{{100 t, invLi[100 t]}, {400 t, 400 t}, {500 t, LogIntegral[500 t]}}, {t, 0, 1}](*FIFTH EXAMPLE*) 500

400

300

Out[169]=

200

100

100

200

300

400

500

APPLICATION. The Famous Prime Theorem may be stated in the form π (x) ≈ li (x) def = Li (x) - log 2 so that Li (x) = π (x) + Li 2 and then -1 x = Li π (x) + Li 2. In Mathematica the Chèbyshev counting prime function is implemented as PrimePi[x]. Thus, the quantity of prime numbers less than or equal x = 997 is In[184]:= Out[184]=

PrimePi107  664 579 This says that there are 168 prime numbers less than or equal 997. As a matter of fact,

In[176]:= Out[176]=

Table[Prime[j], {j, 1, 168}] {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997}

InverseLogIntegral_RG.nb

The number 997 is itself a prime number. On the other hand, the equation x = li-1 π (x) + Li 2 allows us to locate a prime number near x when π (x) is large enough . For example, knowing that π (x) = 18 934 we obtain x = Li-1 18 934 + Li 2 : In[211]:= Out[211]=

invli[18 934 + LogIntegral[2]] 210 997.43239804849705

We got that x = 210 997.43. So there must be a prime number near x = 210 997.43. The closest prime number to this x is 211 007 = 210 997 + 10.

This las inequality may be re - written in the equivalent form Li (x) -

x log (x) 8π

< π (x) < Li (x) +

x log (x) 8π

;

EXAMPLE : In[218]:=

X = 107 ; LogIntegral[X] -

Out[218]=

X Log[X] 8π

, PrimePi[X], LogIntegral[X] +

{662 890., 664 579., 666 946.}

X Log[X] 8π

 // N

7