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.

A340444 a(n) is the least prime of the form p*q + p*r + q*r where p is the n-th prime and q and r are primes < p, or 0 if there are none.

Original entry on oeis.org

0, 0, 31, 41, 61, 71, 151, 101, 199, 151, 227, 191, 211, 311, 241, 271, 487, 311, 479, 653, 521, 401, 421, 727, 491, 823, 521, 541, 773, 571, 641, 661, 691, 701, 751, 761, 1109, 821, 2039, 1399, 1447, 911, 1543, 971, 991, 1607, 1061, 1571, 1831, 1151, 1171, 1201, 1697, 2273, 1291, 1321, 2711
Offset: 1

Views

Author

Robert Israel, Jan 07 2021

Keywords

Comments

If prime(k) is in A023219, a(k) = 5*prime(k)+6.

Examples

			a(7) = 151 because prime(7) = 17, and 151 = 17*3+17*5+3*5 is the least prime of the form 17*p + 17*q + p*q.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,L,i,j,t;
      p:= ithprime(n);
      L:= sort([seq(seq((ithprime(i)+p)*(ithprime(j)+p)-p^2, i=1..j-1),j=2..n-1)]);
      for t in L do if isprime(t) then return t fi od:
      0
    end proc:
    A:= map(f, [$1..100]);
  • Python
    from sympy import isprime, prime
    def aupto(nn):
      alst, plst = [0 for i in range(nn)], [prime(i+1) for i in range(nn)]
      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))
        for s in sorted(p*q + p*r + q*r for p, q, r in t):
          if isprime(s): alst[n-1]=s; break
      return alst
    print(aupto(57)) # Michael S. Branicky, Jan 07 2021