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-1 of 1 results.

A340439 a(n) is the number of primes of the form p*q + p*r + q*r where p is the n-th prime and q and r are primes < p.

Original entry on oeis.org

0, 0, 1, 3, 5, 7, 9, 12, 11, 16, 20, 23, 22, 32, 30, 34, 42, 53, 48, 49, 61, 62, 67, 66, 81, 73, 94, 94, 103, 105, 114, 112, 114, 142, 123, 153, 164, 155, 167, 170, 183, 196, 204, 228, 208, 235, 242, 231, 240, 254, 267, 246, 281, 269, 297, 306, 298, 340, 356, 338, 378, 339, 421, 363, 424, 386
Offset: 1

Views

Author

Robert Israel, Jan 07 2021

Keywords

Comments

A prime is counted only once even if it arises in several ways.

Examples

			a(6) = 7 because prime(6) = 13 and there are 7 such primes:
   71 = 2*3  + 2*13 +  3*13
  101 = 2*5  + 2*13 +  5*13
  131 = 2*7  + 2*13 +  7*13
  151 = 3*7  + 3*13 +  7*13
  191 = 5*7  + 5*13 +  7*13 = 2*11 + 2*13 + 11*13
  263 = 5*11 + 5*13 + 11*13
  311 = 7*11 + 7*13 + 11*13.
		

Crossrefs

Cf. A340444.

Programs

  • Maple
    f:= proc(n) local i,j,t;
      nops(select(isprime, {seq(seq((ithprime(i)+ithprime(j))*ithprime(n)+ithprime(i)*ithprime(j), i=1..j-1),j=2..n-1)}))
    end proc:
    map(f, [$1..100]);
  • Python
    from sympy import isprime, prime
    def aupto(nn):
      alst, plst = [], [prime(i) for i in range(1, nn+1)]
      for n in range(1, nn+1):
        p = plst[n-1]
        t = ((p, plst[i], plst[j]) for i in range(n-2) for j in range(i+1, n-1))
        u = (p*q + p*r + q*r for p, q, r in t)
        alst.append(len(set(s for s in u if isprime(s))))
      return alst
    print(aupto(66)) # Michael S. Branicky, Jan 07 2021
Showing 1-1 of 1 results.