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.

Showing 1-3 of 3 results.

A066938 Primes of the form p*q+p+q, where p and q are primes.

Original entry on oeis.org

11, 17, 23, 31, 41, 47, 53, 59, 71, 79, 83, 89, 107, 113, 127, 131, 151, 167, 179, 191, 227, 239, 251, 263, 269, 271, 293, 311, 359, 383, 419, 431, 439, 443, 449, 479, 491, 503, 521, 587, 593, 599, 607, 631, 647, 659, 683, 701, 719, 727, 743, 773, 809, 827
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 24 2002

Keywords

Comments

For p not equal to q, either p*q or p+q is odd, so their sum is odd.
The representation is ambiguous, e.g. 2*7+2+7 = 23 = 3*5+3+5.
Complement of A198273 with respect to A000040. - Reinhard Zumkeller, Oct 23 2011
None of these primes are in A158913 since if p*q+p+q is a prime, then sigma(p*q+p+q) = sigma(p*q). - Amiram Eldar, Nov 15 2021

Examples

			59 is in the sequence because 59 = 2 * 19 + 2 + 19.
		

Crossrefs

Programs

  • Haskell
    a066938 n = a066938_list !! (n-1)
    a066938_list = map a000040 $ filter ((> 0) . a067432) [1..]
    -- Reinhard Zumkeller, Oct 23 2011
    
  • Mathematica
    nn = 1000; n2 = PrimePi[nn/3]; Select[Union[Flatten[Table[(Prime[i] + 1) (Prime[j] + 1) - 1, {i, n2}, {j, n2}]]], # <= nn && PrimeQ[#] &]
  • PARI
    is(n)=fordiv(n+1,d,my(p=d-1,q=(n+1)/d-1); if(isprime(p) && isprime(q), return(isprime(n)))); 0 \\ Charles R Greathouse IV, Jul 23 2013

Formula

A067432(A049084(a(n))) > 0. - Reinhard Zumkeller, Oct 23 2011
A054973(a(n)+1) >= 2. - Amiram Eldar, Nov 15 2021

Extensions

Edited by Robert G. Wilson v, Feb 01 2002

A067432 Number of ways to represent the n-th prime in form p*q+p+q, where p and q are primes (see A066938).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 1, 1, 0, 0, 3, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 2, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 3, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, 2, 0, 4, 0, 1, 1, 1, 0, 0, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 15 2002

Keywords

Comments

a(A049084(A066938(n))) > 0; a(A049084(A198273(n))) = 0; a(A049084(A198277(n))) = n and a(A049084(m)) <> n for m < A198277(n). [Reinhard Zumkeller, Oct 23 2011]
a(n) < A072670(n).

Examples

			a(15) = 2 as A000040(15) = 47 = 3*11+3+11 = 5*7+5+7.
		

Crossrefs

Programs

  • Haskell
    a067432 n = length [p | let prime_n = a000040 n,
       p <- takeWhile (< a000196 prime_n) a000040_list,
       let (q,m) = divMod (prime_n - p) (p + 1),
       m == 0, a010051 q == 1]
    a067432_list = map a067432 [1..]
    -- Reinhard Zumkeller, Oct 23 2011

A347008 Numbers that can be written in exactly two ways as p*q+p+q where p and q are primes with p < q.

Original entry on oeis.org

23, 47, 119, 167, 179, 323, 407, 419, 527, 587, 639, 647, 879, 935, 1043, 1103, 1119, 1139, 1215, 1223, 1247, 1271, 1331, 1367, 1403, 1455, 1595, 1599, 1631, 1691, 1775, 1791, 1859, 1895, 1931, 1943, 1959, 1967, 1979, 2099, 2111, 2175, 2183, 2219, 2231, 2435, 2471, 2483, 2495, 2543, 2559, 2603
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 10 2021

Keywords

Examples

			a(3) = 119 is a term because 119 = 5*19+5+19 = 3*29+3+29 are the two ways to produce 119 = p*q+p+q with primes p < q.
		

Crossrefs

Cf. A198277.

Programs

  • Maple
    N:= 10000: # to produce terms <= N
    R:= Vector(N):
    P:= select(isprime, [2,seq(i,i=3..N/3,2)]):
    for i from 1 to nops(P) do
      for j from 1 to i-1 do
       v:=P[i]*P[j]+P[i]+P[j];
       if v <= N then R[v]:= R[v]+1 fi
    od od:
    select(t -> R[t]=2, [$1..N]);
  • Python
    from sympy import primerange
    from collections import Counter
    def aupto(limit):
        primes = list(primerange(2, limit//3+1))
        nums = [p*q+p+q for i, p in enumerate(primes) for q in primes[i+1:]]
        counts = Counter([k for k in nums if k <= limit])
        return sorted(k for k in counts if counts[k] == 2)
    print(aupto(2604)) # Michael S. Branicky, Aug 10 2021
Showing 1-3 of 3 results.