cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A270361 Odd primes p for which there exists an odd prime q < p such that p*q - 1 is a square.

Original entry on oeis.org

13, 29, 53, 61, 73, 89, 97, 109, 137, 149, 157, 173, 233, 241, 277, 317, 349, 353, 373, 389, 397, 409, 433, 461, 521, 541, 569, 593, 617, 641, 653, 661, 673, 701, 709, 733, 757, 769, 773, 821, 829, 853, 877, 881, 929, 937
Offset: 1

Views

Author

Richard R. Forberg, Mar 15 2016

Keywords

Comments

Conjecture: For any odd prime p there is at most one odd prime q, with q < p, for which p*q-1 is square.
(Note: If p were not restricted to being prime, there could be multiple primes q which make p*q-1 a square, with increasing multiplicities for larger p. The upper limit on the multiplicity of solutions, for prime and nonprime p and q values, is given by A006278. Note, however that those limits allow for solutions where q=2, and therefore two solutions when p and q are prime.)
a(n) is a subsequence of the Pythagorean Primes (A002144), which are of the form 4k+1.
The density of a(n) values among the primes declines with increasing n. For example, a(n) is about 22% of the first 1000 primes, and drops to about 15% of "incremental" primes around prime(10000). The density continues to fall among even larger primes. Twice those percentages apply as a portion of A002144.
All values of q also belong to A002144. It appears the set of q values "intends to" fully comprise A002144. This is notable because p values comprise an increasingly sparse subsequence within A002144, and each p value has just one q value.
The ability to fully comprise A002144 with q values is further challenged by the fact that for any given q value (i.e., any term of A002144) multiple values of p > q can be found such that p*q-1 is square. Thus q values are "promiscuous", and apparently without bounds on the number of p values they can serve.
Contrast this with primes p and q such that p*q+1 is square. The result are the Twin Primes (A001359 and A006512), arranged in a simple one-to-one correspondence, with p = q+2.

Examples

			13 is in this sequence because 13*5 - 1 = 64, which is square, with 5 < 13.
		

Crossrefs

Cf. A002144.

Programs

  • Mathematica
    result = {}; Do[p = Prime[i]; Do[q = Prime[j]; r = p*q - 1;
      If[Mod[r, 8] == 1 || Mod[r, 8] == 0 || Mod[r, 8] == 4,
       If[IntegerQ[Sqrt[r]], AppendTo[result, p]]], {j, 2, i - 1}],
    {i, 3, 1000}]; result
  • PARI
    lista(nn) = {forprime(p=3, nn, ok = 0; forprime (q=3, p-1, if (issquare(p*q-1), ok = 1; break);); if (ok, print1(p, ", ")););} \\ Michel Marcus, Apr 06 2016
  • Python
    from gmpy2 import is_prime, is_square
    for p in range(3, 10 ** 4, 2):
        flag = 0
        if is_prime(p):
            for q in range(3, p, 2):
                if is_square(p * q - 1) and is_prime(q):
                    flag = 1
                    break
        if flag:
            print(p, end=", ")
    # Soumil Mandal, Apr 07 2016