Proc. Indian Acad. Sei. (Math. Sei.), Vol. 92, No. 1, September 1983, pp. 49-52. 9 Printed in India.

Formula for primes, twinprimes, number of primes and number of twinprimes

A VENUGOPALAN Sree Vidya, 5/1153, VH Road, Calieut 673001, India

MS received 16 June 1983; revised 5 August 1983

Abstract. Formulae for computing the nth prime, twinprime, the number of primes smaller than a given , and the number of twinprimes smaller than a given integer are presented. Proofs for the development are also furnished.

Keywords. Primes; twinprimes

1. Introduction

Let Pl = 2, P2 = 3, P3 = 5 ..... Pn be the of the first n primes, and,

Q = fl Pi (I) i=l This paper presents formula to compute the (n + l)th prime which is p.+ 1 and other allied results. Let Qi=Q/Pi, for i=1,2,3 ...... n (2) 1 ~< ai ~< (p~- 1) K = n -~ (l/p,) (3) 1 0 ~< b ~< [K], where [K] denotes the integral part of K and

n J = ~aiQi-bQ (4) ! The following four theorems are first proved.

THEOREM 1. For n greater than 1, (p, - I) (p.- 1) X J = X + (l/X) +f(X) +f(1/X) (5) al=l a~=l 0~< b ~< I'r] wheref(X) = ~a.X" 1 < m <<.[K]Q fl (1- (1/pi)), (m, Q)= 1, and i=1 am = 1 for all m < Q and (m, Q) = 1 and a~ = 0 for some m/> Q. 4 49 50 A Venuoopalan

THEOREM 2. For n greater than 1, (pt - 1) (p,- 1) E...E X ~ = 2X+20(X) (6) al •l a. ffil where

g(X) .~- Eo~X ra2

1 < m <~ [K]Q fi (1 - (1/pi)), (m, Q) = 1 i=1 and am as defined in Theorem 1.

THEOREM 3. For n greater than 1, Let (a~, a~, a~ ..... a~,) be the unique solution of -2 -= Y.~ a~Q~ mod Q, with 0 ~< at <~ (p,- 1), (1, 2, 3 ..... n). Then, 0~ - 1) (p.- 1) E ... E E = E x- (7) a't~at=l a'. ~ a. = 1 0~

THEOREM 4. For n greater than 1, E.--EE E x-'

2. Proofs

The proofs of the theorems 1 and 2 follow from the remarks given below. First, given any integer c there is a unique solution of

~ aiQi - c mod Q (10) i=! subject to 0 ~< ai ~< (p~ - 1), (i = 1, 2, 3 ..... n). The proofs of the theorems 3 and 4 follow from the remarks given below. Formula for primes, twinprimes etc. 51

Subject to 1 ~< ai <<. (Pi- 1) for all i, we have secured (m, Q) = L If in addition, the condition that ((m + 2), Q) = 1 is to be satisfied, we should have

aiei - 1 Qi ,

That is to say a~ # a'~ for each i. By a similar method, it is possible to ensure {[m(m+2)(m+6)], Q} = 1 (12) and so on. Remark 3. In Theorem 2, substituting (_j2) for (j2), we get

(pl - 1) (p.-- t) -d~ = E "" E ~ X 2(X-I+X-F~'+,+...) (13) at=i b=l b=l where X is any given positive number. Therefore, 89 -1 = M = (X -f.§ + X-PZ'§ + .... ) (14) where LHS stands for the expression on the left side of the equation. Multiplying both sides of the above equation by X p-~§ we get M.X p~.+, = 1 +X -p~,*~+p~,+, + .... 1 +R (say). For values of X i> 2, it is clear that R < 1. Therefore,

1 < M.X f,', < 2 (15) Taking logarithms of both sides of (15), to the base X, we get 0 < p,2+i +IogxM < I

p2+ 1 > - logx M > P~+I2 -1 That is to say, the integral part of (- logx M) is equal to (p2+ 1 - 1)~ and, [ [' (p~,-- 1) {p.--l) ,~, )] p,L~ = 1+ -logxll/2 Y.... Y. x-~;,,~,-~:-(1/x) . \ atffil ~.=1 b=l (16) Equation (16) is thus the formula for the (n + 1)th prime. P is the first twinprime in (p., p2) if P differs from zero by the equation:

(17) where Yis given by the below expression: [ (0,1-I) y2=1+ -log x 1/2 ~ ... X-r176 . a'l ~t al ffi l a" ~t a. ffi 1 b=l (18) It could be noted that when Y< p2 P=Y (19) 52 A Venuoopalan and when Y > p2 P=O. Therefore, the above expression gives only twinprimes. Remark 5. For any x in (p., p2), the number of primes not more than x is given by 1 fi" hsin((Q-Q')/2)O)'sin((n-1)QO/2).sin([x]O/2)cos(([x] + 1)0/2) H(x) = ~nn i = 1 sin (Qfl/2). sin (QO/2)sin (0/2) x d0+n. (20) Noting that the angles in each set by the summation are in arithmetic progression, the above equation can be proved by summing over a., a._ 1, a._ 2 ..... al, from, 1 f2z(p~-l) n(x)-n(p.) ~ d o a,E = l " " " 0,.- l)(. - 1) Ix] ~, Y' ~, cos(Y:]aiQi-bQ)Ocos(tO)dO. (21) a,=l b=l f=l Remark 6. If 1-I2(x) represents the number of twinprimes not exceeding x; p. < x ~< p.~, then, 1 ~ ... rI=(x)- ri2(p.) = al # a~ {.- l) [x] ~, ~ ~ cos(X]a,Q,-bQ)O.cos(tO)dO. (22) a,.~a',b=l t=l

Since all the twinprimes up to p. are known, ~2(P.) is known. 1 /~2x (n- 1) Ix] ri2(x) ! 5" 9 E Y dO all'~a'l a,, # a'ab =1 I=1 cos (~]aiQi - bQ)Ocos (tO)dO + II2(p.). (23) The twinprime follows immediately if the right side (23) is greater than 1-I2(p,)

3. Detailed proofs for remarks 4 and 5

Detailed proofs for remarks 4 and 5 with numerical examples, application in connection with P.+I, P, II(x) and l'Iz(x) will be furnished in a separate paper.

Acknowledgement

The author wishes to thank Prof. K Ramachandra for encouragement.