# Patterns in A129783?

David Wilson davidwwilson at comcast.net
Thu May 24 02:54:10 CEST 2007

```A129783 is intended to include all numbers for the form k^2 - pq >= 0, p and
q are consecutive primes.

For prime p, let q = smallest prime > p, that is p and q are consecutive
primes.

Now define S(p) = {k^2 - pq: k^2 - pq >= 0}. S(p) is the set of values
contributed to A129783 by p, and we see that A129783 is the union of S(p)
over all primes p.

If p = 2, S(p) = {k^2 - 6: k >= 3} is what it is.

So let p be odd. Then m = (q+p)/2 > 0 and g = (q-p)/2 > 0 are integers. Call
g the semigap of p (half the gap between p and the next prime q).

Clearly m^2 = pq + g^2 >= pq, and for small p, we find that m^2 is the least
square >= pq. Is this true for all odd primes p?

Suppose it is not true for some p. Then there is a square smaller than m^2
which is >= pq, in particular, (m-1)^2 >= pq. Letting m = p+g and q = p+2g,
a little math gives

[1] (g-1)^2 >= 2p.

Suppose prime p with semigap g satisfies [1]. Let p' be the smallest prime
with semigap g. Then (g-1)^2 >= 2p >= 2p', and p' satisfies [1] as well.
Therefore, to show that [1] is satisfied for any particular semigap g, we
need only check that [1] is satisfied for g and the smallest prime p with
semigap g.

For 1 <= g <= 595, the smallest prime p with semigap g is given by p =
A000230(g). None of these g and p satisfy [1], furthermore, theoretically
and empirically, 2p = 2*A000230(g) grows faster (g-1)^2, so it seems
unlikely that [1] will be soluble for g > 595, either.

So m^2 is almost certainly the smallest square >= pq for all prime p, (and
definitely for p with g <= 595). Assuming this is true, we have

S(p) = {(m+k)^2 - pq: k >= 0} = {g^2 + (p+q)k + k^2: k >= 0}.

The smallest element of S(p) is g^2. The k-tuple conjecture implies that for
any g > 0, there exist consecutive primes p and q with semigap g, putting
g^2 in S(p) and in A129783. This implies that N^2 (the positive squares) is
a subset of A129783.

If A129783 does include N^2, we have

A129783

= UNION(p prime; S(p))

= N^2 U UNION(p prime; S(p)) (since N^2 is a subset of A129783)

= N^2 U S(2) U UNION(p odd prime; S(p))

= N^2 U S(2) U UNION(p odd prime; S(p)-{g^2})

Removing g^2 from S(p) does not affect the union because g^2 is already
included in N^2. Letting

S'(p) = S(p)-{g^2} = {g^2 + (p+q)k + k^2: k >= 1}

we get

A129783 = N^2 U S(2) U UNION(p odd prime; S'(p)).

------------------------------------------------------------------------------------

To recap, assuming the following very solid conjectures that 2*A000230(g) >
(g-1)^2 for g >= 1 and the k-tuple conjecture we get

[2] A129783 =

(N^2 = {k^2 | k >= 1})

U (S(2) = {k^2 - 6: k >= 3})

U UNION(odd prime p; S'(p) = {k^2 + (p+q)k + g^2: k >= 1})

where q = least prime > p and g = (q-p)/2.

If [2] is true (as it very likely is) then:

- It is straightforward to compute all elements of A129783 <= n. Since the
smallest element of S'(p) exceeds 2p, S'(p) for p >= n/2 has no elements <=
n and need not be considered.

- As NJAS asks in a comment on A129783, 2 is not in A129783.

- As John Schoenfield conjectures in a recent post, the only repesentation
of 3 as x^2 - pq is indeed 3 = 3^2 - 2*3. In fact, precisely the positive
squares have an infinite number of representations as x^2 - pq.

Straightforward duplicates:

A121987 and A121988
A051786 and A072714
A120666 and A120667
A064580 and A064581

Possible duplicates:

A077934 and A077973
http://www.research.att.com/~njas/sequences/?q=id:A077934|id:A077973
(another similar pair: A077893 and A077953)

A060543 and A108287
http://www.research.att.com/~njas/sequences/?q=id:A060543|id:A108287

A052509 and A052511
http://www.research.att.com/~njas/sequences/?q=id:A052509|id:A052511

A103921 and A115623 (Look very much alike, is the ordering ever different?)
http://www.research.att.com/~njas/sequences/?q=id:A103921|id:A115623

A008480 and A123298 and A124793 (someone double-check? I'm 99% sure.)
http://www.research.att.com/~njas/sequences/?q=id:A008480|id:A123298|id:A124
793

```