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.

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.

This page as a plain text file.
%I A340439 #17 Jan 07 2021 21:12:34
%S A340439 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,
%T A340439 73,94,94,103,105,114,112,114,142,123,153,164,155,167,170,183,196,204,
%U A340439 228,208,235,242,231,240,254,267,246,281,269,297,306,298,340,356,338,378,339,421,363,424,386
%N 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.
%C A340439 A prime is counted only once even if it arises in several ways.
%H A340439 Robert Israel, <a href="/A340439/b340439.txt">Table of n, a(n) for n = 1..1000</a>
%e A340439 a(6) = 7 because prime(6) = 13 and there are 7 such primes:
%e A340439    71 = 2*3  + 2*13 +  3*13
%e A340439   101 = 2*5  + 2*13 +  5*13
%e A340439   131 = 2*7  + 2*13 +  7*13
%e A340439   151 = 3*7  + 3*13 +  7*13
%e A340439   191 = 5*7  + 5*13 +  7*13 = 2*11 + 2*13 + 11*13
%e A340439   263 = 5*11 + 5*13 + 11*13
%e A340439   311 = 7*11 + 7*13 + 11*13.
%p A340439 f:= proc(n) local i,j,t;
%p A340439   nops(select(isprime, {seq(seq((ithprime(i)+ithprime(j))*ithprime(n)+ithprime(i)*ithprime(j), i=1..j-1),j=2..n-1)}))
%p A340439 end proc:
%p A340439 map(f, [$1..100]);
%o A340439 (Python)
%o A340439 from sympy import isprime, prime
%o A340439 def aupto(nn):
%o A340439   alst, plst = [], [prime(i) for i in range(1, nn+1)]
%o A340439   for n in range(1, nn+1):
%o A340439     p = plst[n-1]
%o A340439     t = ((p, plst[i], plst[j]) for i in range(n-2) for j in range(i+1, n-1))
%o A340439     u = (p*q + p*r + q*r for p, q, r in t)
%o A340439     alst.append(len(set(s for s in u if isprime(s))))
%o A340439   return alst
%o A340439 print(aupto(66)) # _Michael S. Branicky_, Jan 07 2021
%Y A340439 Cf. A340444.
%K A340439 nonn
%O A340439 1,4
%A A340439 _Robert Israel_, Jan 07 2021